Recent

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

Pascal

  • Hero Member
  • *****
  • Posts: 932
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 (21H2)

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
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.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.


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: 6130
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