Re: [Haskell-cafe] Behaviour of System.Directory.getModificationTime

2010-12-22 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/17/10 06:22 , Arnaud Bailly wrote: Thanks for your answers. I am a little bit surprised, I thought timestamps were on the milliseconds scale. POSIX timestamps are seconds. - -- brandon s. allbery [linux,solaris,freebsd,perl]

Re: [Haskell-cafe] Behaviour of System.Directory.getModificationTime

2010-12-17 Thread Arnaud Bailly
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

Re: [Haskell-cafe] Behaviour of System.Directory.getModificationTime

2010-12-16 Thread Arnaud Bailly
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@haskell.org

Re: [Haskell-cafe] Behaviour of System.Directory.getModificationTime

2010-12-16 Thread Thomas Schilling
Yes, modification times are reported in seconds, so you'll have to wait on average 0.5s for a file change to be visible via the modification date. Due to buffers and filesystem optimisations it might even take longer. On 16 December 2010 16:50, Arnaud Bailly arnaud.oq...@gmail.com wrote:

Re: [Haskell-cafe] Behaviour of System.Directory.getModificationTime

2010-12-16 Thread Krzysztof Skrzętnicki
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