Using `purge` instead of `delete` when removing a directory in a compatible rclone mount

I'm not very familiar with FUSE or the inner workings of rclone so my assessment could be wrong but it looks to me like rclone uses delete on the backend when deleting folders in a FUSE mount.

This is very slow compared to purge since delete has to go through each file and manually delete it while purge simply moves the target folder to trash. This is of course useful when filtering is needed but in the case of removing a directory, no filtering is done.

Also, I realize that purge is not supported by every remote, so this would have to be a remote-dependent feature.

Please let me know if this feature request makes sense. Again, I'm not very familiar with FUSE, so perhaps the reason this wasn't already implemented was due to restrictions it places.

Thanks!

that would be a nice feature.

in the end, it is more about the OS and what it supports.
afiak, they do not offer purge

Maybe you're right. I was hoping FUSE/WinFSP offered some way to get around that. But you're probably right that the OS expects to have to go through each child file to delete a folder.

If someone with more insight into FUSE reads this I'd appreciate your input.

Purge doesn't check for any filters.

Delete does check for filters.

Delete needs to go one by one since it obey's filters.

That does make sense. You and @asdffdsa's comment has made me realize this request is impossible. Thank you both for the insight!

before i first posted, i searched libuse for the work purge, got zero results.
https://github.com/search?q=repo%3Alibfuse%2Flibfuse+purge&type=code
https://github.com/search?q=repo%3Alibfuse%2Flibfuse+purge&type=issues
https://github.com/search?q=repo%3Alibfuse%2Flibfuse+purge&type=pullrequests

1 Like

You are correct. That is how the OS to Fuse interface works.

We could make the Fuse remove directory into purge but I have a nasty feeling that the OS would still delete all the files individually.

The other thing the OS never tells us about is copy, so Fuse mounts never do server side copy even though they could.