leojs icon indicating copy to clipboard operation
leojs copied to clipboard

Import File command Failed With Read Errors

Open tbpassin opened this issue 1 year ago • 2 comments

I tried to import a javascript file using the minibuffer command import-file but it failed repeatedly with the following message:

EntryIsADirectory (FileSystemError): Error: EISDIR: illegal operation on a directory, read
	at C._handleError (c:\Users\tom\AppData\Local\Programs\VSCodium\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:151:7668)
	at Object.readFile (c:\Users\tom\AppData\Local\Programs\VSCodium\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:151:5564)
	at async AtFile.openFileHelper (c:\Users\tom\.vscode-oss\extensions\boltex.leojs-0.2.13-universal\dist\extension-node.js:2:1138701)
	at async AtFile.readFileToUnicode (c:\Users\tom\.vscode-oss\extensions\boltex.leojs-0.2.13-universal\dist\extension-node.js:2:1138200)
	at async AtFile.openFileForReading (c:\Users\tom\.vscode-oss\extensions\boltex.leojs-0.2.13-universal\dist\extension-node.js:2:1128421)
	at async AtFile.read (c:\Users\tom\.vscode-oss\extensions\boltex.leojs-0.2.13-universal\dist\extension-node.js:2:1129467)
	at async LeoImportCommands.importDerivedFiles (c:\Users\tom\.vscode-oss\extensions\boltex.leojs-0.2.13-universal\dist\extension-node.js:2:1525852)
	at async Commands.importAnyFile (c:\Users\tom\.vscode-oss\extensions\boltex.leojs-0.2.13-universal\dist\extension-node.js:2:846404)

From the error message, I would guess that the code is getting the directory name instead of the file name from the file-open dialog return value.

LeoJS:

LeoJS 0.2.13, master branch, build e696124
2024-04-28 22:42:42 -0400
Node.js v18.18.2, VSCode version 1.88.1
Windows 10 Home x64 (build 10.0.19045)
      home: C:\Users\tom
leo-editor: C:\Users\tom\.vscode-oss\extensions\boltex.leojs-0.2.13-universal

tbpassin avatar May 01 '24 15:05 tbpassin

@tbpassin Thank you for filing this issue.

Indeed this looks like a small error about using a directory method or path instead of a file for the read operation.

boltex avatar May 02 '24 00:05 boltex

Now fixed in devel. 😄

boltex avatar May 20 '24 02:05 boltex