RE: tail -f behaviour in ghc.

28 Aug
2001
28 Aug
'01
5:24 a.m.
I suspect this is more of a "my patchy knowledge about file handles" question than a ghc or a Haskell question, but at the risk of revealing same in public...
Is it possible to implement "follow mode" behaviour, a la tail -f, without using "seek" (or hSetPosn, which I assume is essentially seek slightly abstractified). Essentially this comes down to whether once a handle reaches "eof", whether than can be subsequently falsified.
Sure, EOF is checked every time you read rather than being cached after the first time it occurs (actually this is the case in the new I/O library in 5.02, I'm not sure about 5.00.2). So it's reasonable to do a sleep/read loop similar to 'tail -f'. Cheers, SImon
8666
Age (days ago)
8666
Last active (days ago)
0 comments
1 participants
participants (1)
-
Simon Marlow