EldoS | Feel safer!

Software components for data protection, secure storage and transfer

OnEnumerateDirectory and OnCloseEnumeration

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#6686
Posted: 06/19/2008 11:45:10
by Sid Schipper (Standard support level)
Joined: 03/14/2008
Posts: 285

In using the Callback File System I was making an assumption that I have now found to be untrue. My assumption was that if the OnEnumerateDirectory callback was called for a directory that eventually the OnCloseEnumeration would also be called for that directory. I have come across a situation where this does not happen. I will explain to you the exact sequence of events to reproduce it and you can tell me what I am doing wrong or why I do not see what I expect to see.

I have a virtual disk with some folders and subfolders on it. When I first open the root directory on that disk I see everything I am expecting to see, the OnEnumerateDirectory gets called for each folder in the folder tree for the disk and the OnCloseEnumerate gets called correspondingly for all the folders.

I then navigate to another folder on my hard drive and drag and drop a small file on to a subfolder of the root directory on my virtual disk. At that point I am in the Visual C++ Debugger and I get a call to OnEnumerateDirectory for both the root directory of my Virtual Disk and the subfolder where I am dropping the file. But, I do not ever get a corresponding OnCloseEnumerate for the root directory, I only get an OnCloseEnumerate call for the directory that I am dropping the file onto. This is not a good thing for my system, I need to know for every directory that is Enumerated when the enumeration ends, since I need to do some database cleanup stuff that is critical to my system. Could you explain to me why this is happening?
#6687
Posted: 06/19/2008 11:59:06
by Eugene Mayevski (EldoS Corp.)

Please remember to specify the API you are using. We have about 5000 of users (and I remember the names of most of their companies) so keeping all user details in memory is quite hard.

The OS sends the closing request when it finishes enumeration. In fact the directory is "opened" and enumeration close request comes in the form of "close file or directory" request (on the OS level). I think that the OS doesn't distinguish handles of different open operations. So if you have CallAllOpenCloseCallbacks set to false, then you will get the closing notification only when the last handle is closed (which in your case is a handle opened during file copy). Try setting CallAllOpenCloseCallbacks to true if it is false.

In general, your problem needs reproducing and investigation and maybe special handling.


Sincerely yours
Eugene Mayevski
#6690
Posted: 06/19/2008 12:07:47
by Sid Schipper (Standard support level)
Joined: 03/14/2008
Posts: 285

I can't set CallAllOpenCloseCallbacks to true, it slows down my system to a crawl making it totally unusable.

The API I am using is the Visual C++ library interface and I would be only too glad to send you anything you need to reproduce and investigate this problem.
#6691
Posted: 06/19/2008 12:14:36
by Eugene Mayevski (EldoS Corp.)

Try setting the property to true and see if the problem occurs in that scenario. This will give us the idea what's happening there.


Sincerely yours
Eugene Mayevski
#6693
Posted: 06/19/2008 14:03:13
by Volodymyr Zinin (EldoS Corp.)

Perhaps the problem is with the AllowDelayedClose method. If it's set to true then the CallbackFS delays closing of files and directories and such behavior implicitly influences on OnCloseEnumerate calls - they can be delayed too.
Try to set AllowDelayedClose to false and check the problem.
Thanks.
Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.

Reply

Statistics

Topic viewed 3150 times

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




|

Back to top

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

Got it!