EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Cannot delete file

Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.
#7311
Posted: 08/15/2008 07:52:49
by Dan Cooper (Basic support level)
Joined: 06/27/2007
Posts: 125

That is correct, OnDelete is called which fails because we still have a stream open to the file. If all OnClose events had been called then the stream would have been closed.
#7312
Posted: 08/15/2008 08:12:26
by Volodymyr Zinin (EldoS Corp.)

Try to set AllowDelayedClose to false and check whether the problem is gone.
#7313
Posted: 08/15/2008 08:17:27
by Dan Cooper (Basic support level)
Joined: 06/27/2007
Posts: 125

AllowDelayClose is already set to false.
#7321
Posted: 08/15/2008 09:31:12
by Volodymyr Zinin (EldoS Corp.)

Quote
Dan Cooper wrote:
That is correct, OnDelete is called which fails because we still have a stream open to the file. If all OnClose events had been called then the stream would have been closed.

Is this OnDelete callback called for the file or for the parent directory where the file is located?
#7323
Posted: 08/15/2008 09:33:11
by Dan Cooper (Basic support level)
Joined: 06/27/2007
Posts: 125

I'm not sure but we are seeing the issue for renames also, the item being renamed is the parent directory.

#7324
Posted: 08/15/2008 09:35:41
by Dan Cooper (Basic support level)
Joined: 06/27/2007
Posts: 125

This happens much more frequently on Vista but we do see the problem on XP also.
#7325
Posted: 08/15/2008 09:53:11
by Volodymyr Zinin (EldoS Corp.)

Could you provide some sample for reproducing the problem? And describe actions that cause the bug.
Also please specify what type of the CallbackFS library (.NET1.1, .NET2.0, Delphi or C++) are you using?
Thanks.
#7328
Posted: 08/15/2008 09:58:01
by Dan Cooper (Basic support level)
Joined: 06/27/2007
Posts: 125

We are using .NET 1.1.

We can reliably reproduce the problem by opening a folder containing lots of executable files, and changing views a few times (to open the icons from the executable). Then move up a directory and try to rename that folder. We always get an error as there will be a handle still open to one of the files within the folder.
#7329
Posted: 08/15/2008 10:02:06
by Dan Cooper (Basic support level)
Joined: 06/27/2007
Posts: 125

It will be very difficult to provide a sample as this is part of a very large application which relies on a lot of additional code. I can tell you that there are no exceptions being thrown in any of our callbacks and that we only log the open handle after it has been opened and log the close on the first line of the OnClose callback. This always ends up with one file having an unmatched OnOpen/OnClose event.

We have seen this exception on one occasion which may be related?

System.InvalidOperationException: Handle is not initialized.
at System.Runtime.InteropServices.GCHandle.FromIntPtr(IntPtr value)
at System.Runtime.InteropServices.GCHandle.op_Explicit(IntPtr value)
at CbFsCloseFile(CallbackFileSystem sender, CbFsFileInfo FileInfo, IntPtr FileHandleContext)

This is being thrown from

(FileContext)((GCHandle)FileHandleContext).Target

after checking

((GCHandle)FileHandleContext).IsAllocated

Although we have only seen this on one occasion so it may be completely unrelated.
#7332
Posted: 08/15/2008 10:20:41
by Volodymyr Zinin (EldoS Corp.)

At least I understand why the OnClose callback is not called (due to the exception). Thanks. We'll work on it.
Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.

Reply

Statistics

Topic viewed 25992 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!