EldoS | Feel safer!

Software components for data protection, secure storage and transfer

cancel reading

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.
#8612
Posted: 01/13/2009 11:29:04
by Khayralla AL-Athari (Standard support level)
Joined: 09/23/2008
Posts: 75

Quote

So all handling of disk absence should be done in OnFileOpen


Already I handl this case in CbFsOpenFile

Code
private void CbFsOpenFile(...)
{
     if (FileHandleContext.Equals(IntPtr.Zero))
     {
        VirtualFile vfile = null;
        if (FindVirtualFile(FileName, ref vfile))
        {
            GCHandle gch = GCHandle.Alloc(vfile);
            FileHandleContext = GCHandle.ToIntPtr(gch);
            if(Media(FileName) is offline)
            {
                throw new ECBFSError(ERROR_FILE_NOT_FOUND);
                //throw new ECBFSError(ERROR_INVALID_DRIVE);
            }
            ...
         }
     }
}

However, cbfs raise CbFsReadFile many times.

Quote

First load the media, then open the file.

the case is there is no media.

Any way, I handle this, but I am looking for the right way.

thanks Eugene.

#8614
Posted: 01/13/2009 12:27:58
by Eugene Mayevski (EldoS Corp.)

Hmm. If your file opening code throws an error when the file is offline, how can file read request come for this file? The file was not opened, how can it be read? This is not possible.


Sincerely yours
Eugene Mayevski
#8618
Posted: 01/13/2009 14:12:14
by Khayralla AL-Athari (Standard support level)
Joined: 09/23/2008
Posts: 75

After doing more test on only one file and with some logs, the repeating was in the OnOpenFile (throw error added later to OnOpenFile) and happened more than one time and that's resonable as Vladimir says:
Quote

It's the system cache manager repeats the OnRead/OnWrite request several times and the CallbackFS core only passes it to the user callbacks.


thanks

#13995
Posted: 07/23/2010 00:02:07
by Mezeo Support (Basic support level)
Joined: 12/29/2009
Posts: 40

Another question - I am using ERROR_RETRY as the error code. The "Try again" option works (as in the operations continues as expected). However in case of "Cancel" the operation hangs. Is there any specific call from cbfs when cancel is called that can be used? As an example the operation could be file copy.
#13996
Posted: 07/23/2010 06:41:47
by Volodymyr Zinin (EldoS Corp.)

What does it mean - "operation hangs"?

Quote
Mezeo Support wrote:
Is there any specific call from cbfs when cancel is called that can be used?

There isn't. What callbacks are called depends on behavior of the originator program. Usually when an operation is cancelled (for example "read file") the originator program can show an error message to a user and then closes the file handle which causes the OnClose callback call.
#13997
Posted: 07/23/2010 07:28:29
by Mezeo Support (Basic support level)
Joined: 12/29/2009
Posts: 40

Thanks for the input.

"Operation hangs":

When a copy file operation is going on and because of some errors the originator program sends "ERROR_RETRY" code to CBFS, the window shown gives the option of "Try Again" and "Cancel". If the cancel button is selected the copy operation does not get canceled and the originator program is unable to proceed ahead. That is what was meant by "Operation hangs". So, I wanted to know if there was any specific call from CBFS when Cancel is selected. On that call the originator program could perform some specific tasks to gracefully exit the operation.
#13999
Posted: 07/23/2010 08:53:39
by Volodymyr Zinin (EldoS Corp.)

I will try to reproduce it and then answer to you.
#14009
Posted: 07/25/2010 15:10:37
by Volodymyr Zinin (EldoS Corp.)

I have not been able to reproduce it.
Could you modify the CallbackFS Mounter sample so it would be possible to reproduce the problem and give it to us. Also please specify what Windows version (including if it's 32- or 64-bit) you are using.
Thanks.

Quote
Mezeo Support wrote:
So, I wanted to know if there was any specific call from CBFS when Cancel is selected.

What operations are performed in this case depends on a program which does a file copying. Perhaps you will find some dependencies in callback calls (for example in the case of copying a file in Explorer) and be able to recognize the Cancel command.
Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.

Reply

Statistics

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