digitalmars.D.learn - Is there anything in the standard library to help writing a file
- Gary Willoughby (5/5) May 23 2013 Is there anything in the standard library to help writing a file
- Benjamin Thaut (9/13) May 23 2013 I have something like this implemented for windows. It watches a entire
- David (3/20) May 23 2013 For Linux you can use inotify
- Jacob Carlborg (5/7) May 23 2013 I think the corresponding for Mac OS X is fsevents:
- Gary Willoughby (4/4) May 23 2013 Hmmm.. this is what i first thought. I think i'll implement a
- Zz (3/7) Jul 15 2013 https://code.google.com/p/simplefilewatcher/
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?
May 23 2013
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
May 23 2013
Am 23.05.2013 17:35, schrieb Benjamin Thaut:Am 23.05.2013 17:26, schrieb Gary Willoughby:For Linux you can use inotify http://linux.die.net/man/7/inotifyIs 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
May 23 2013
On 2013-05-23 18:19, David wrote:For Linux you can use inotify http://linux.die.net/man/7/inotifyI think the corresponding for Mac OS X is fsevents: http://en.wikipedia.org/wiki/FSEvents -- /Jacob Carlborg
May 23 2013
Hmmm.. this is what i first thought. I think i'll implement a simple watcher based on modification times as a first iteration. Then if time allows add platform specific solutions based on the above. Thanks.
May 23 2013
https://code.google.com/p/simplefilewatcher/ may help with platform specific solutions. On Thursday, 23 May 2013 at 18:56:41 UTC, Gary Willoughby wrote:Hmmm.. this is what i first thought. I think i'll implement a simple watcher based on modification times as a first iteration. Then if time allows add platform specific solutions based on the above. Thanks.
Jul 15 2013