Open steelywing opened 2 months ago
Exists on 0.95 as well. Looks to be OS-specific (Windows). Can't reproduce on Linux, but I can (partially) on Windows.
However, using the example above, I also can't reproduce the actual deletion, but only the attempted deletion. However, it seems that it would be guaranteed to fail if run from the current directory:
↪ rm -rf .*
Error: nu::shell::remove_not_possible
× Remove not possible
â•â”€[entry #23:1:8]
1 │ rm -rf .*
· ─┬
· ╰── Could not delete C:\temp\nu-test: The process cannot access the file because it is being used by another process. (os error 32)
╰────
Error: nu::shell::remove_not_possible
× Remove not possible
â•â”€[entry #23:1:8]
1 │ rm -rf .*
· ─┬
· ╰── Could not delete C:\temp\nu-test\rm-test: The process cannot access the file because it is being used by another process. (os error 32)
╰────
That said, if you run the rm -r <path_to>/.*
from a parent directory it will delete successfully.
Worse, a rm -rf <path_to>/<subdir>/.*
will recursively delete multiple-levels-upwards. This could be catastrophic.
Moving the final line of my previous comment out to a separate message, because it's important.
Running rm -rf <path_to>/<subdir>/.*
will recursively delete multiple-levels-upwards. This could be catastrophic.
Describe the bug
Warning: this will remove the parent folder, create an extra sub folder before test this bug
rm -r .*
will remove parent folder, I lost some of my file due to this 😢How to reproduce
Warning: this will remove the parent folder, create an extra sub folder before test this bug
nu will try to delete the parent folder, I think nu try to delete
.
and..
, butrm .*
should only remove files that start.
in current directoryExpected behavior
Don't delete parent folder
Screenshots
No response
Configuration
Additional context
No response