in reply to Re: Re: Best way to read line x from a file
in thread Best way to read line x from a file

No, seek() is not wasteful, however it doesn't really understand the concept of a line either. Seek basically blitzes its way to the location requested, so any future reads start from that location. You can also use seek to go backwards in a file too. But again, it doesn't work on the principle of "lines", instead it works on "byte offsets". That's why in your case it would only work if every line is of the same length.

- - arden.
arden is more of an orangutan than a monkee

  • Comment on Re: Re: Re: Best way to read line x from a file