in reply to Re^4: head truncate
in thread head truncate
Your fixes were the ones that came to mind when the issue first occured to me. However, I spent a while to come up with a different approach because I don't like that version for two reasons, detailed in Dominus' "red flag" articles.
eof tries to read a byte from the handle, then rewinds the file. Basically, it's a kludge.
Also, you need to set an $eof flag before copying, then check it later. Flag variables are not integral to the algorithm at hand and usually mean the implementation is not a natural way to express that algorithm.
I updated my second post to fix the problems you mentioned. Only cosmetics this time, luckily.. :-)
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re^5: head truncate
by sauoq (Abbot) on Sep 14, 2002 at 00:35 UTC |