Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: shell-safe-rm can't deal with symbolic links on Linux #11

Open
bunop opened this issue Mar 31, 2017 · 0 comments
Open

BUG: shell-safe-rm can't deal with symbolic links on Linux #11

bunop opened this issue Mar 31, 2017 · 0 comments

Comments

@bunop
Copy link
Contributor

bunop commented Mar 31, 2017

shell-safe-rm can't deal with symbolic links pointing to directories, for example:

$ export SAFE_RM_DEBUG=1
$ cd /tmp/
$ mkdir test
$ ln -s test test_link
$ rm test_link
[D] file test_link
[D] 1 files or directory to process: test_link
[D] ls_result: test_link
[D] 216: test_link: is a directory
safe-rm: test_link: is a directory
[D] remove returned status: 1
[D] EXIT_CODE 1

The only way to delete a link to a directory is to pass -r parameter, unlike the standard rm will do:

$ rm -r test_link
[D] short option -r
[D] file test_link
[D] recursive    : -r
[D] 1 files or directory to process: test_link
[D] ls_result: test_link
[D] trash test_link
[D] mv test_link to /home/developer/.local/share/Trash/files/test_link-2017-03-31_12:25:11-0
[D] 254: trash returned status 0
[D] remove returned status: 0
[D] EXIT_CODE 0

I think I've resolved this issue, I will submit a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant