[Haskell-cafe] Behaviour of System.Directory.getModificationTime
Arnaud Bailly
arnaud.oqube at gmail.com
Fri Dec 17 12:22:10 CET 2010
Thanks for your answers. I am a little bit surprised, I thought
timestamps were on the milliseconds scale.
@Krzysztof: Yes, you are right, an event-based interface is far
superior to the basic polling approach I took. At present, a couple
seconds granularity is fine with my use case so I don't care too much
getting more precise notifications, but I'd rather be notified by the
kernel than going through the hassle of polling it myself.
I played a bit with inotify (through a Java binding) a year ago and
found it a bit cumbersome to wield as one has to monitor explicitly
all nodes in a tree. Maybe I am wrong. Moreover, I am not aware of a
portable way of doing this.
I would appreciate pointers and advices on these matters.
Thanks again,
arnaud
2010/12/16 Krzysztof Skrzętnicki <gtener at gmail.com>:
> If this is not a toy program I would really suggest using something that is
> builtin in the OS of choice. On Linux there is inotify
> (http://en.wikipedia.org/wiki/Inotify), but I'm pretty sure that other OSes
> have similar interfaces. The "modification time" method seems really fragile
> and I probably not very efficient as well.
> Best regards,
> Krzysztof Skrzętnicki
>
> On Thu, Dec 16, 2010 at 17:50, Arnaud Bailly <arnaud.oqube at gmail.com> wrote:
>>
>> actually, IRL the code works as expected. Might it be possible that
>> the speed of test execution is greater than the granularity of the
>> system's modification timestamp?
>>
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
More information about the Haskell-Cafe
mailing list