Instantly delete a directory without recursion?

50 views
Skip to first unread message

ElvisCheng

unread,
Jun 3, 2016, 3:36:31 AM6/3/16
to OSXFUSE
hi all,
In OSXFUSE,when we delete a directory, what they do under the hood is they iterate through the subdirectories and files and delete them first.since I developed a network disk,in this case it would product fragment in server.
Is there a way to solve this problem?
thanks


Sam Moffatt

unread,
Jun 6, 2016, 4:22:45 PM6/6/16
to osxfus...@googlegroups.com
Most operating systems under the hood iterate through the subdirectories to recursively delete them. I don't know of a modern operating system that permits you remove a non-empty directory. This isn't a behaviour unique to OSXFUSE but is a standard operating system behaviour. 

What you can do is buffer within your filesystem the changes locally and if your network server supports this handle the delete atomically. The risk is that your app dies before the delete propagates and then obviously the uncommitted deletes wouldn't go through. That's obviously a trade off you need to assess and maybe that actually makes more sense for you.

Cheers,

Sam

--
You received this message because you are subscribed to the Google Groups "OSXFUSE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osxfuse-grou...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages