EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Send File Via TCP Onwrite

Posted: 07/18/2012 21:43:22
by Bhushan Manekar (Premium support level)
Joined: 07/18/2012
Posts: 10

Hey Everyone!

I am new to using the Callback File system and I am getting confused on a few small aspects of it.

I've noticed that the OnWrite event is called several times for larger files, apparently with each having a maximum buffer size of ~64kb (?). My aim is to place code in this portion, so when a user places a file into the directory I can copy it to a network location. The problem is, how do I handle this situation given that I am obtaining pieces and not the whole file buffer?

It would be managable I think If I somehow had the total file size so I could assertain when it was completed and finalize everything...

I may be way off the mark, but would appreciate any advice,

Adrian G.W.
Posted: 07/18/2012 23:51:35
by Eugene Mayevski (Team)

You can track when the new file is created using OnCreateFile and/or OnOpenFile (to ensure that the file is opened for writing or created), then wait until OnCloseFile for this file and schedule the transfer there. Note - you should not do the transfer directly in OnCloseFile event handler. Instead you can post a message or in other way communicate with the worker thread that you create which will do transfers. OnCloseFile must be completed quickly and unconditionally.

Sincerely yours
Eugene Mayevski



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