Recent

Author Topic: How to monitor a folder for changes  (Read 390 times)

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 269
How to monitor a folder for changes
« on: October 22, 2020, 02:52:34 pm »
Hi,

How to monitor a folder for changes (new/modified files/folders) with Cocoa in macOS? Is there any examples on FPC?

MarkMLl

  • Hero Member
  • *****
  • Posts: 1446
Re: How to monitor a folder for changes
« Reply #1 on: October 22, 2020, 02:57:52 pm »
I've done it on linux but I don't know whether the same API is applicable to Macs.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1052
  • Former Delphi 1-7, 10.2 User
Re: How to monitor a folder for changes
« Reply #2 on: October 23, 2020, 01:48:52 am »
See File System Events and packages/univint/src/FSEvents.pas
o Lazarus v2.1.0 r63871, FPC v3.3.1 r47164, macOS 10.14.6 (with sup update), Xcode 11.3.1
o Lazarus v2.1.0 r61574, FPC v3.3.1 r42318, FreeBSD 12.1 amd64 (VMware Fusion VM)
o FPC 3.0.4, FreeBSD 12.2-STABLE r365646 amd64
o Lazarus v2.1.0 r61574, FPC v3.0.4, Ubuntu 20.04 (Parallels VM)

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 269
Re: How to monitor a folder for changes
« Reply #3 on: October 23, 2020, 01:37:13 pm »
trev,
Mark,

Many thanks for your replies!

I'll learn FSEvents now.

Alextp

  • Hero Member
  • *****
  • Posts: 1153
    • UVviewsoft

 

TinyPortal © 2005-2018