EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Network filelisting retrieval and reporting

Posted: 09/22/2015 11:16:15
by ANIS ABDUL (Standard support level)
Joined: 09/02/2014
Posts: 13

We are working on using CBFS to create a drive that allows showing a cloud storage as a local network drive. It works for the most part but I have couple of questions that I am hoping I can get some ideas on.

Here is how I have it implemented the enumeration call.
1. Once the drive is mounted, enumeration call for the root folder "/" is received. At that point, if the "Restart" is 1 or if no filelisting for that folder is is already cached from previous network call, then
I return "FileFound" as "FALSE" and issue a background network call to retrieve data.

2. Once the background network call is complete, for each of the entry it raises NotifyDirectoryChange with fanAdded .

It looks for each of the NotifyDirectoryChange, I get a enumeration call from OS with "Restart" set to 1 which in turn causes network file listing retrieval over and over.

My question is, Am I even doing this correctly? Should I not be using NotifyDirectoryChange to cause the filesystem to retrieve the filelisting again? I am currently raising the NotifyDirectoryChange for every single file item.

Looking forward to your help.
Posted: 09/22/2015 12:18:48
by Volodymyr Zinin (Team)

Hello Anis,

NotifyDirectoryChange is necessary only if something in your "backend" cloud storage has been changed. For example some new file was created there. CBFS knows nothing about "backend" storage changes, so in order to notify it about such changes NotifyDirectoryChange is used. After you called it CBFS performs necessary callback calls and update information about created/deleted/modifed files and directories inside the virtual disk.
Posted: 09/22/2015 12:36:38
by ANIS ABDUL (Standard support level)
Joined: 09/02/2014
Posts: 13

Hi Volodymyr

Thank you for your response. Since I am doing asynchronous retrieval (and not hang the system while doing network call in the same context as the EnumerateDirectory call), Is there a way to notify the filesystem to re issue the enumerateDirectory call after the network call retrieves the filelisting?

Is there a standard method of doing this action of handling network filelisting?

Posted: 09/22/2015 12:57:06
by Volodymyr Zinin (Team)

All CBFS callbacks are expected to handle synchronously. Of course during directory enumeration you can return only those file/directory listing that you currently obtained and then use NotifyDirectoryChange with fanAdded for any new files/subdirectories. Although such algorithm can cause much more directory enumeration request to come. And the reason of it is not in CBFS but in programs which trace file system changes on the CBFS disk. For example some program instead of getting only information about the added file can decide to enumerate completely the directory to which the file was added.



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