EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Get file when remote

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.
#15690
Posted: 02/07/2011 14:35:22
by jonathan weizman (Basic support level)
Joined: 02/07/2011
Posts: 6

Hi

When the file is remote,should :
*i download completly in a local place before open
*download a stream ?
Any sample?
thanks
john
#15691
Posted: 02/07/2011 14:57:25
by Eugene Mayevski (EldoS Corp.)

If you get an open call, in most cases you just won't be able to download the complete file during short time, given for handling of open operation. So the best you can do is to open the file (send a request to the remote host) and start caching the file data in a separate thread to have it available for a system. In general, caching 8 Kb of data per file is enough - Windows Explorer reads between 4 and 8K of each file when the user enters the directory. You can inspect, what process is requesting an open operation, and if it's one of known processes, act differently (for example, Explorer almost never opens the files for other purpose than to get metadata and build thumbnails, and some office package would read the complete file).

As for samples - there exist lots of different scenarios so we don't have a suitable sample so far. We will consider adding some sophisticated samples for network operations, but this will happen later this year and will involve SecureBlackbox as a transport (SecureBlackbox supports variety of internet protocols).


Sincerely yours
Eugene Mayevski
#15695
Posted: 02/08/2011 10:52:05
by jonathan weizman (Basic support level)
Joined: 02/07/2011
Posts: 6

Thank you for the answer.

Trying to remote read the file, i was wondering what is the difference between:
CbFsReadFile and CbFsOpenFile

Also why CbFsReadFile is constantly called ?
Thanks
john
#15696
Posted: 02/08/2011 11:04:36
by Eugene Mayevski (EldoS Corp.)

OnOpenFile is called in response to CreateFile() WinAPI call, and OnReadFile is called in resoponse to ReadFile() WinAPI call. Of course, for each file read operation a separate OnReadFile is called.


Sincerely yours
Eugene Mayevski
#15706
Posted: 02/09/2011 07:44:55
by jonathan weizman (Basic support level)
Joined: 02/07/2011
Posts: 6

Hum, i have the feeling that it is called even when not requested...
For example, i found that CbFsReadFile is called when the user clicks only once on the file...

Is the expected behavior is not to trigger CbFsReadFile on DoubleClick ?
Otherwise it will read all the file only when clicking ?

Thanks
#15707
Posted: 02/09/2011 08:56:35
by Eugene Mayevski (EldoS Corp.)

You are now thinking in terms of UI events, which don't have one-to-one mapping to lower level system events. I don't know what exactly click or double-click does on your computer. If something asks the system to open the file or to read it, then corresponding callback is called. We (as developers) don't care what it is. If you are curious enough, use GetOriginatorProcessName from within the callback code and read the name of the process, whose activity caused this or that callback call.


Sincerely yours
Eugene Mayevski
#15708
Posted: 02/09/2011 11:03:35
by jonathan weizman (Basic support level)
Joined: 02/07/2011
Posts: 6

Not really...
I have taken the VirtualFile Sample from the .net directory and just had a Console.Writeline in the CbFsReadFile.
I draged dropped a Word file there and whenever i click on it on the explorer i can see that the function is called 5 to 10 times..
#15709
Posted: 02/09/2011 11:19:02
by jonathan weizman (Basic support level)
Joined: 02/07/2011
Posts: 6

Actually i have seen a difference between txt files and other formats...
txtfiles are called once
#15710
Posted: 02/09/2011 11:31:45
by Eugene Mayevski (EldoS Corp.)

As I said, it's the application that initiates file reads, so you should ask the application's author about what it is doing and what for. If it's Explorer, then maybe it tries to read the metadata from the file. Of course, depending of the file type there can be different (or no) metadata and this causes different number of reads.


Sincerely yours
Eugene Mayevski
#15718
Posted: 02/10/2011 02:00:12
by Volodymyr Zinin (EldoS Corp.)

You can see what program perform reading by the use of Process Monitor from sysinternals.com. Run it and set to filter I/O requests for your CallbackFS virtual disk. The filter there can be for example so:
"Path"->"Begins with"->"X:" (where "X:" is a drive letter for your disk).
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 3829 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!