Append & delete text in the middle of a file

Heinz billgates at microsoft.com
Wed Jan 10 18:15:18 PST 2007


== Quote from Heinz (billgates at microsoft.com)'s article
> Hi,
> I'm trying to replace a value that's in the middle of a text file (using class
> File: std.stream.Stream). I'm able to set the cursor position to the beginning
> of the value but in order to replace it i must delete it and append text,
> there's no way or members to delete chars with the stream class neither append
> text (except at eof). The provided write operations replace the value but it
> also replaces other text because the data to write is longer than the original
> value.
> Does anybody have an idea to help me?
> Thanx guys.

By 'append' i mean 'insert'. Anyway you can't insert text just like that into the
middle of a file so i'll use a slice stream from the end of the value to the end
of file then i'll append this slice in the end of the written value.


More information about the Digitalmars-d-learn mailing list