[linux] EISDIR: illegal operation on a directory
See original GitHub issuetrash
(invoked, in my case, via trash-cli
) does not seem to work on directories in Linux (in my case, Ubuntu 19.10).
$ trash {src,test,build}/**/*.{js,d.ts,map}
Error: EISDIR: illegal operation on a directory, copyfile '/builds/build/es6' -> '/root/.local/share/Trash/files/c862ddbe-a1f8-4589-b545-fe260f81e2e9'
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Error: EISDIR: illegal operation on a directory, read · Issue #658
What is the current behavior? I have an project which is a react native project called th_views.rn and in the project there's a...
Read more >EISDIR: illegal operation on a directory when enable Remote ...
EISDIR : illegal operation on a directory when enable Remote Debug in Managed workflow. And the hot reload stops. Tried update Node, NPM...
Read more >NPM stuck giving the same error EISDIR: Illegal operation on ...
Windows : NPM stuck giving the same error EISDIR : Illegal operation on a directory, read at error (native) [ Beautify Your Computer ......
Read more >Next js app on Azure Linux web app - Error eisdir illegal ...
... Linux web app - Error eisdir illegal operation on a directory read ... I would like to run this in Azure web...
Read more >File System
OS X and Linux fs.open('<directory>', 'a+', (err, fd) => { // => [Error: EISDIR: illegal operation on a directory, open <directory>] }) //...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can’t say I’ve entirely solved it yet, but I took some time to try to at least narrow the issue down.
The problem seems to be in
lib/linux.js
, specifically the call tomake-dir
, and related to permissions. I happen to keep the project I’m encountering this in on a separate partition from my home directory, on a scratch drive/mnt/scratch/bla/bla/...
./mnt/scratch
is writable only byroot
, not my user account. Since there is no.Trash...
directory on this partition, it seemstrash
attempts to create one, and fails due to permissions. If I copy a checkout oftrash-cli
byte for byte, it runs fine from under my home directory and fails under/mnt/scratch
. (And I was confused for a while because the tests oftrash
itself pass just fine even after I added a failing case fortrash-cli
—but then I realised it creates and works from a temp dir.)To be honest, I do not know what the behaviour ought to be when trashing something on this partition. Is it supposed to fail? Should it perhaps use my default trash directory, as in
xdgTrashdir.all()
? Should it try to create a ‘local’ one and fall back to the default? Is my setup just basically broken in terms of trash directory setup?I’m also not sure if this is the same behaviour I’ve seen in all cases/on all machines, but it’s definitely a potential cause of failure. Please let me know if I can be of any more help—running test cases or whatever.
In case anyone isn’t aware, you can bypass the alias via:
\rm