EldoS | Feel safer!

Software components for data protection, secure storage and transfer

File size on read

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
Posted: 12/06/2009 15:14:08
by Steve Oliver (Basic support level)
Joined: 12/06/2009
Posts: 3


I'm running into a problem and need some help understanding what's going on. I'm running on Windows XP Pro using .Net CBFS libs.

I create a file on my virtual disk and read it with notepad and then close it. Then, the file is modified by a process external to my Windows system. This process adds some bytes to the end of the file. I then go back and read the file with notepad and I do not see the additional data. Before I read the file I have updated the virtual file EOF to reflect the new file size. The new size is passed back in the OnGetFileInfo() callback. I thought that this would inform the file system of the new file size. When the file read request is made, the bytesToRead parameter is set to the old file size. What do I have to do to make the file system aware of the new file size so that I can read the entire file?

Posted: 12/06/2009 19:54:20
by Gavin McKay (Standard support level)
Joined: 09/01/2009
Posts: 48

Hi Steve,

Explorer maintains its own internal cache of file sizes. CbFS informs explorer of the file size to expect.

In your example, your CbFS app tells explorer the size of the file. Something else then updates the file, and you update your CbFS. However you also need to use the [URL=https://www.eldos.com/documentation/cbfs/ref_cl_cbfs_mtd_notifydirectorychange.html]NotifyDirectoryChange[/URL] method to notify Explorer of the change. Explorer should then get the correct size from your internal data.

Posted: 12/06/2009 22:59:41
by Steve Oliver (Basic support level)
Joined: 12/06/2009
Posts: 3


Thanks for the help. This problem has been driving me nuts all weekend. It's working now.

Posted: 12/07/2009 02:27:14
by Volodymyr Zinin (EldoS Corp.)

Hello Steve,

For more details look for NotifyDirectoryChange in this forum. There were quite a lot of discussions here.



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