EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Callback FS onFileClose

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
#4485
Posted: 12/13/2007 05:29:58
by Hawazen Otaibi (Basic support level)
Joined: 12/13/2007
Posts: 6

Hi,

Am trying to develop an application that caches data (files) from a remote connection.

I was able to pull files, cache them for in memory use, My problem is that the onFileClose is not being triggered after editing a file on notepad and saving it. I want to handle onFileClose so I would finally write the resulting file to the remote location.

I used the example provided with CBFS as a skeleton for my program.

Thanks in advance
#4486
Posted: 12/13/2007 07:25:26
by Volodymyr Zinin (EldoS Corp.)

Hi,

The operating system (to be more precise - it's the system cache manager) holds references to the files which were opened. In hope that these files will be opened again soon and their contents are already in the system cash. That's why the close callbacks are not called for a long time. But you can forcibly close the system's references by means of ReleaseUnusedFiles from the CallbackFS api. You can call it periodically to release such files.
Also internally the CallbackFS driver also delays closing files in hope that these files will be opened again soon and data structures that were created internally by the driver for these files will be reused. In the next build this feature can be disabled but the ReleaseUnusedFiles call also releases these files.
#4560
Posted: 12/23/2007 02:50:25
by Hawazen Otaibi (Basic support level)
Joined: 12/13/2007
Posts: 6

Hi,

I just noticed the new version of CBFS: 1.2.18

Is this the release where I can disable system cache?
#4561
Posted: 12/23/2007 03:52:09
by Eugene Mayevski (EldoS Corp.)

In version 1.2 you can try calling AllowDelayedClose(false) and see if this solves the problem.


Sincerely yours
Eugene Mayevski
#4562
Posted: 12/24/2007 02:06:38
by Volodymyr Zinin (EldoS Corp.)

Hi,

Quote
Vladimir Zinin wrote:
The operating system (to be more precise - it's the system cache manager) holds references to the files which were opened. In hope that these files will be opened again soon and their contents are already in the system cash. That's why the close callbacks are not called for a long time.

If you set the UseSystemCache attribute to TRUE then this feature will be disabled too.
#4563
Posted: 12/25/2007 08:23:00
by Hawazen Otaibi (Basic support level)
Joined: 12/13/2007
Posts: 6

Hi,

Setting AllowDelayedClose to false did the trick. onFileClose is being called properly now.
Thanks for the help.
Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.

Reply

Statistics

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