core: Error when creating index: illegal operation on a directory

When I run the command npx make-index --output src\osdrive or npx make-index -o src\osdrive , i get the same illegal operation on a directory error.

PS C:\Users\e79217\Downloads\CeetahOS> npx make-index --output src \osdrive
Generated listing for Users/e79217/Dwnloads/CheetahOS
node:fs:2341
    return bindlng.writeFileUtf3( 
                  ^

Error: EISDIR: illegal operation on a directory, open 'C:\Users\e79217\Downoads\CheetahOS\src\osdrive'
	at writeFileSync (node:fs:2341:20)
	at file:///C:/Users/e79217/Downloads/CheetahOS/node_modules/@zenfs/core/scripts/make-index.js:213:1
	at ModuleJob.run (node:internal/modules/esm/module_job:262:25)
	at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:485:26)
	at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:109:5)
errno: -4068,
code: 'EISOIR',
syscall: 'open',
path: 'C:\\Users\\e79221\\Downloads\Cheetah06\\src\\osdrive

What could be the cause? And again, thanks for the assist

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 27 (12 by maintainers)

Most upvoted comments

No. configure will reconfigure the FS every time you call it. It is intended to be run once, so I recommend you run it once during program initialization. If you have access to top-level await, I strongly encourage you to use it.

If you would like to continue using a flag, A guard clause would be more readable (and decrease indentation):

private async initZenFSAsync(): Promise<void> {
	if(this._isFileSystemInit) {
		return;
	}

	await configure({
		// ...
	});
	this._isFileSystemInit = true;
}

Also @chinonso098 Please stop posting screenshots of your code. It is next to impossible to copy the code, which is making helping you very difficult. As stated in the contributing.md, โ€œPlease copy logs, terminal output, and code into a code block in the issue or PR. Do not include screenshots since those are very difficult to debug.โ€ So far Iโ€™ve manually been rewriting your screenshots into code blocks but it is making me a little frustrated. Sorry to give you all this, but its important to follow the guidelines on issues.

Thank you, thank you, thank you

We have data ๐Ÿ™‚๐Ÿ™‚๐Ÿ™‚

image

@chinonso098 --output/-o expects a file path, not a directory. It is used to customize the index JSON file path.

Iโ€™ve included the output of make-index --help for your reference:

$ npx make-index --help
make-index <path> [...options]

path: The path to create a listing for

options:
        --help, -h              Outputs this help message
        --quiet, -q             The command will not generate any output, including error messages.
        --verbose               Output verbose messages
        --output, -o <path>     Path to the output file. Defaults to listing.
        --ignore, -i <pattern>  Ignores files which match the glob <pattern>. Can be passed multiple times.