EldoS | Feel safer!

Software components for data protection, secure storage and transfer

notifyDirectoryChange in Java

Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.
#20122
Posted: 05/11/2012 08:29:22
by Sergey Zagriychuk (Basic support level)
Joined: 03/28/2012
Posts: 2

Hi, I want to redfresh folder like press F5. After reading your knowledge base I,ve understood that I have to call method notifyDirectoryChange, but after testign this method directory was not updated (F5 working), my calls for notifyDirectoryChange is next

Code
callbackFileSystem.notifyDirectoryChange(fileInfo.getFileName(), 3, true)


Also, I've tested for folder that contains this file result the same.
How can I call this method correctly to get effect "F5 push" ?
Thanks.
#20123
Posted: 05/11/2012 08:57:15
by Volodymyr Zinin (EldoS Corp.)

By the use of callbackFileSystem.notifyDirectoryChange you notify the listeners (programs that usually use the win32 API ReadDirectoryChangesW) about the specified file/directory changing. So it depends on a listener how it postprocesses such changing - either it rereads the directory contents at all or performs some additional analysis and rereads only the file for which the notifyDirectoryChange has been called.
#20124
Posted: 05/11/2012 09:11:33
by Volodymyr Zinin (EldoS Corp.)

BTW if you are using notifyDirectoryChange with a flag another than fanMetaDataModified then in the case the file is now opened its handles will be marked as invalid. After that the only successful operation with such handles will be CloseHandle.
It was implemented so because notifyDirectoryChange was made to report about changes occurred outside CallbackFS and if a file data was changed outside, then manipulating with the file's old data (e.g. writing to it, etc) can cause the new file's data corruption.
#20125
Posted: 05/11/2012 09:35:12
by Sergey Zagriychuk (Basic support level)
Joined: 03/28/2012
Posts: 2

OK, Look , I've mounted disk and created
Code
new file
, so path to new file is
Code
//new file
. After this I've renamed new file to
Code
test file
, and want to update root folder(//) to see just a test file, What have I done, just call
Code
callbackFileSystem.notifyDirectoryChange("//", 3, true);
and wait , result two files, if I press f5 just
Code
test file
#20131
Posted: 05/12/2012 05:25:23
by szagriichuk  (Basic support level)
Joined: 03/28/2012
Posts: 51

Read here https://eldos.com/forum/read.php?FID=13&TID=1817&MID=10200&sphrase_id=392355#message10200 about notification all files, all is OK.
Thanks.
Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.

Reply

Statistics

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