tail -f behaviour in ghc.
Simon Marlow
simonmar@microsoft.com
Tue, 28 Aug 2001 10:24:14 +0100
> 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=20
> revealing
> same in public...
>=20
> 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