Re: file position
* James Kanze:
> On Jun 30, 9:26 am, "Alf P. Steinbach" <al...@start.no> wrote:
>> * nko...@gmail.com:
>
>>> When outputting or inputting to a file is there some easy
>>> way to move to and overwrite a specific line?
>
>> No, not if you're talking about an ordinary text file.
>
> If you know the length of the line, there is. You have to save
> the position prior to reading the line.
You're talking about a special case where (1) you've been at that line sometime
earlier, (2) you saved the position then, and (3) the new line is exactly the
same length as the old.
There are often such rare corener special cases that are possible for something
that isn't possible in general.
It's quite misleading to put that up as if it contradicted what I wrote.
>> That hasn't anything to do with C++, it has to do with the
>> structure of an ordinary text file.
>
> Not really.
Really. ;-)
For the general problem, it's the same in any language.
Cheers, & hth.,
- Alf
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
|