[fpc-pascal] Watching for file change

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Sat Apr 12 22:08:20 CEST 2014


Henry Vermaak wrote:
> On Sat, Apr 12, 2014 at 12:32:14AM +0100, Graeme Geldenhuys wrote:
>> On 2014-04-11 20:06, Krzysztof wrote:
>>> idea how to do this in thread loop but maybe FPC has OS solution
>> As the others have said, the OS solutions are very version/distro
>> dependent - especially under Linux which changes underlying
>> functionality every 6 months or so (so damn annoying).
> 
> No, the linux solution isn't distro dependent, since it's in the kernel.
> inotify came in 2005-ish to deprecate dnotify, but even dnotify still
> exists (read the man page for fcntl).  The kernel guys are pretty
> serious about not breaking userspace interfaces.

I've just been running a kernel build and note that there are explicit 
dnotify and inotify options, so what's built in is very much at the 
discretion of the distro maintainers.

> If you're using some other userspace daemon to do this (like FAM), then
> you're at their mercy.

I notice that Gamin claims to be a subset/derivative of FAM. I think 
that I'd be inclined to test for the existence of one of the daemons 
first, since if they were being used by other components of the system 
(e.g. a file manager) they'd probably cache.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-pascal mailing list