file numbers, puts, seek and NT 4
- Posted by "Bruce M. Axtens" <bruce_axtens at SIL.ORG> Apr 23, 1999
- 410 views
I suppose its written down somewhere, but with the following program, gday.ex, puts( 1, "G'day mate, 'owyergoin?" ) in Windows NT 4.0, repetitively executing ex gday >> gday.log does not build up a file full of G'day's. Rather the puts simply writes the file with a single line over and over again. If you want the append to occur you have to rewrite the program as seek( 1, -1 ) puts( 1, "G'day mate, 'owyergoin?" ) and then it will work as expected. This does not appear to be the case under Windows 95 or MSDOS. This is a hidden gotcha. Either that or I have finally gone round the twist. If its the latter, I can cope with the embarrassment. If the former, the documentation better say something about it. Bruce.