spion / adbfs-rootless

Mount Android phones on Linux with adb. No root required.
Other
908 stars 73 forks source link

`rmdir` on non-empty folders deletes folders #28

Open samueldr opened 6 years ago

samueldr commented 6 years ago
RMDIR(1)                                            User Commands                                           RMDIR(1)

NAME
       rmdir - remove empty directories

SYNOPSIS
       rmdir [OPTION]... DIRECTORY...

DESCRIPTION
       Remove the DIRECTORY(ies), if they are empty.

[...]

If they are empty. I haven't verified where the fault lies, it could lie in the coreutils rmdir (unlikely), in fuse, or in adb. The fact is, using rmdir * to clear a folder from empty folders is a bad idea™ using adbfs-rootless.

I am sorry if this sounds rude, but uh, at least I had backed up what was important right before. 😕 That's one way to make space on your phone.

spion commented 6 years ago

It doesn't sound rude at all. Sorry!

I pushed a commit that relieves the immediate problem (i.e. the folder doesn't get removed if not empty) although it doesn't report a proper error yet.

samueldr commented 6 years ago

Oh, ah, I see why it acted like rm -r. Thanks for the quick follow-up!