Error: EISDIR illegal operation on a directory, open '{path to a dir in the zip file}'
- Dominant language
- JavaScript
- Stars
- 419
- Forks
- 55
- PR merge metrics
- No merged PRs in 30d
Description
Hi Folks,
I am facing this issue of illegal operation when I am trying to unzip a zip file which has multiple directories in it using decompress module.
Is it something related to the permissions of the particular zip file?
Sample Code:
var unzipFiles = async function (dirPath, dcmfolder) {
const files = fs.readdirSync(dirPath);
await Promise.all(
files.map(async (file) => {
const fullFilePath = path.join(dirPath, "/", file);
if (file.endsWith(".zip")) {
console.log("Inside unzip if condition");
await decompress(fullFilePath, dcmfolder);
}
})
);
};
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the sample code with a ZIP archive containing multiple directories and inspect how decompress handles directory entries. Confirm whether extraction attempts to open a directory as a file, then verify that archives with nested directories extract without the EISDIR error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100