Recent

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

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 304
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: 1804
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: 1217
  • 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 2.1 r64368 FPC 3.3.1 r48100 macOS 10.14.6 Xcode 11.3.1
o Lazarus 2.1 r64392 3.3.1 Jan 13 21:24 macOS 11.1 aarch64 Xcode 12.3
o Lazarus 2.1 r61574 3.3.1 r42318 FreeBSD 12.1 amd64 VMware VM
o Lazarus 2.1 r61574 3.0.4 Ubuntu 20.04 Parallels VM
o Lazarus 2.0.10 3.2.0 Win10 Parallels VM

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 304
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: 1174
    • UVviewsoft

 

TinyPortal © 2005-2018