EldoS | Feel safer!

Software components for data protection, secure storage and transfer

OnGetFileInfo & User Context

Posted: 04/21/2016 11:47:59
by Roland Krikava (Basic support level)
Joined: 04/21/2016
Posts: 12


I'm using CBFS to provide a virtual drive interface to data in the cloud, using http to fetch the data. My questions is as follows:

If minimally accessing the root folder, through lets say the command shell and not explorer, the sequence is as follows:

OnFileOpen '\'
OnEnumerateDir 'Dir A'
OnEnumerateDir 'Dir B'
OnGetFileInfo 'Dir A'
OnFileOpen 'Dir A'

Unless I respond in OnGetFileInfo for 'Dir A' by returning FileExists=TRUE and setting attributes to identify 'Dir A' as a directory, the subsequent OnFileOpen for 'Dir A' will fail. The question is, why can I not access user context data that was set in OnFileOpen for '\' in the OnGetFileInfo callback for 'Dir A'. Without access to the context data in OnGetFileInfo, I will either need to implement directory tree caching outside of CBFS or repeat the http get made in the original OnOpenFile for '\'. Neither is ideal. Am I missing something?

Posted: 04/22/2016 05:51:57
by Volodymyr Zinin (Team)


Thank you for interesting of our product. OnGetFileInfo is not connected with file/directory opening. This callback is called when CBFS asks for the information about a file/directory. And the requested file is specified by its full name (with path). The parent directory for this file can be not opened at the moment of the OnGetFileInfo call, so in this case the context data for the parent directory will be NULL.
Although it is possible to implement an API which will allow to request any existing user context. Something like GetFileInfo(FullPathToItem) method.
Posted: 04/22/2016 13:43:00
by Roland Krikava (Basic support level)
Joined: 04/21/2016
Posts: 12

Could you explain your last point? If I understand you correctly, if a FileOpen for 'Dir A' has occurred, and has not yet closed, the user context set in FileOpen would somehow be accessible from OnGetFileInfo by calling a method with the full path to 'Dir A'? Which method would accomplish this?
Posted: 04/22/2016 14:03:13
by Volodymyr Zinin (Team)

Currently it is not accessible and it is not possible from the OnGetFileInfo callback to obtain such context by the use of Callback File System methods.
Posted: 04/22/2016 14:12:29
by Eugene Mayevski (Team)

Let me add, that context is something that you create in your application (CBFS just holds a reference to it). You can easily have a hash map that will contain paths and contexts. Add an entry to the hashmap in OnOpenFile, then use such hash map in OnGetFileInfo event handler (and remove the entry from the hashmap in OnCloseFile).

It's much easier to implement this logic in user mode, than to put it to the driver, where there are no hashmaps and where development is generally much harder.

Sincerely yours
Eugene Mayevski
Posted: 04/22/2016 14:18:09
by Roland Krikava (Basic support level)
Joined: 04/21/2016
Posts: 12

OK, Thanks. I wanted to rule this out before doing so.



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