EldoS | Feel safer!

Software components for data protection, secure storage and transfer

How to reliable get the base folder of a delete command on a sub-tree?

Posted: 06/09/2009 10:11:28
by Eduardo Segura (Basic support level)
Joined: 06/08/2009
Posts: 2

Hi everyone,

Context: When the user deletes a non-empty folder, that folder is the very last one to be sent to the DeleteFile callback.

Is there any way for us to be able to know this in advance? We need to "unlink" that subtree at its root.

There is a [URL=http://www.eldos.com/forum/read.php?FID=13&TID=1202]similar thread[/URL] related to this one, but unfortunately, the solution for that one doesn't translate to our scenario.

Any ideas would be greatly appreciated.

All the best,
Posted: 06/09/2009 11:03:07
by Eugene Mayevski (Team)

The answer is the same as in the referenced post - that's not possible.

Sincerely yours
Eugene Mayevski
Posted: 06/09/2009 11:23:49
by Eduardo Segura (Basic support level)
Joined: 06/08/2009
Posts: 2

Hi Eugene,

Thanks for your reply. However, please allow me not to give up so quickly :)

Do you think something like the following would work? I'd like to capture all the deletions in a "burst", returning "success" to each one of them (yes, not good, but bear with me for a second, we might be fine with this scenario).
This implies a second thread that would actually perform the operations at a later time. Now the problem is: Can this "burst" be differentiated in any way? By means of timestamps, or maybe order of operations?

I'm thinking of the timing, since these operations should be called within milliseconds of each other. Something that a user could not do on a "manual" basis.
Is the timing reliable? Could there be a situation where an external agent somehow influences this "burst" of deletions?
Posted: 06/09/2009 12:18:04
by Eugene Mayevski (Team)

Of course, you can postpone actual deletion operation for a couple of seconds and if there's a call to delete the directory, you would delete the directory without issuing "delete file" commands. However, you will get a conflict when one thread reports on computer A that the files have been deleted, and the server will report to computer B that the files are still present. Of course your scenario would work in some specific use cases.

Sincerely yours
Eugene Mayevski
Posted: 06/09/2009 13:01:21
by Volodymyr Zinin (Team)


Some words about a non-empty folder deletion mechanism.
File systems don't allow to delete a non-empty folder. So when a user deletes it by means of some program, it's up to this program how to delete it. Usually file manager programs such as File Explorer enumerate files (and sub-folders too, those can also contain files and sub-folders) in a folder being deleted and delete all of them. And only after that they perform the main directory deletion. But the algorithm can be different.



Topic viewed 3243 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!