NEED HELP: fread, fwrite, fseek, ftell

William Davidsen davidsen at sungod.steinmetz
Thu May 4 06:43:55 AEST 1989


In article <2445 at solo3.cs.vu.nl> maart at cs.vu.nl (Maarten Litmaath) writes:

|Solution: insert
|
|	fseek(swabfile, ftell(swabfile), 0);
|
|At first sight this looks like a no-op, but there are some `interesting'
|side-effects...

  I wasn't going to say anything, but this is a real kludge solution
(it works, however). If you do
	fseek(swabfile, 0L, 1);
It avoids the call to ftell. There's no reason to "tell me where I am
and then seek back there," when "move me zero bytes from where I am"
will suffice.



More information about the Comp.unix.xenix mailing list