How to FSEEK previous line of text?

Henry Spencer henry at zoo.toronto.edu
Thu May 9 01:46:38 AEST 1991


In article <4508.28269613 at iccgcc.decnet.ab.com> maslar at iccgcc.decnet.ab.com writes:
>Does anyone know of a function or technique that is similar to FSEEK
>that will allow me to go back to the previous line? ...

There is no provision for this in the standard libraries, because it can
be arbitrarily hard to implement on systems that store text files in odd
ways.  You can build it yourself, however, by simply using ftell() to keep
track of the location of the previous line, and fseek()ing there on demand.
-- 
And the bean-counter replied,           | Henry Spencer @ U of Toronto Zoology
"beans are more important".             |  henry at zoo.toronto.edu  utzoo!henry



More information about the Comp.lang.c mailing list