Recent

Author Topic: How to monitor directory / file changes on network share (Windows 2012 and up)  (Read 6424 times)

Pascal

  • Hero Member
  • *****
  • Posts: 911
Is there a way to get notified of changes to directories on a network share
respectively what is the best way to do so? Can be Windows only.
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (2004)

Thaddy

  • Hero Member
  • *****
  • Posts: 10466
You can write a small windows service that broadcasts any change. For the change itself there is something in the jcl I believe. Otherwise I have KOL code that can be translated back.
When you ask a question that is actually answered in the documentation, you are either lazy or a moron.


guest60499

  • Guest
Some of those solutions seem to use a polling loop instead of the Windows API for filesystem notifications.

The DirWatch project seemed to be the easiest to understand.

jamie

  • Hero Member
  • *****
  • Posts: 3526
find an exampl eof FIndFIrstChangeNotification inside a
thread.

 when the thread receives notice of change, you can then
post a user message to a different thread window, like the
main window for example. from there the message can be
handled like any other message handler in the form..

 
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018