Is there anything in the standard library to help writing a file watcher?

David d at dav1d.de
Thu May 23 09:19:22 PDT 2013


Am 23.05.2013 17:35, schrieb Benjamin Thaut:
> Am 23.05.2013 17:26, schrieb Gary Willoughby:
>> Is there anything in the standard library to help writing a file
>> watcher? I want to monitor a single file for changes and if a change is
>> detected call a function. Is there any existing libraries to do this in
>> D as it must be cross-platform as much as possible?
> 
> I have something like this implemented for windows. It watches a entire
> directory including subdirectories (optional) and tells you which files
> changed upon request:
> 
> https://github.com/Ingrater/thBase/blob/master/src/thBase/directory.d
> 
> I don't think its possible to imiplement this cross-plattform. You will
> have to reimplement for every plattform you need it on.
> 
> Kind Regards
> Benjamin Thaut

For Linux you can use inotify

http://linux.die.net/man/7/inotify


More information about the Digitalmars-d-learn mailing list