On Jun 13, 10:40 am, "Bernie" <indico(at)gmx-topmail.dewrote:
How can I remove/delete the last n characters from a fstream object?
You can't.
First of all, of course, an fstream doesn't contain any
characters; it is only an interface to an external file which
contains the characters. But there's no standard way of
truncating a file, either (and some OS's don't support it at
all). The usual solution is to copy the file to a new file,
without copying what shouldn't be copied. There will often be
an OS specific means of truncating the file as well, but you
can't use it on an fstream; you'll have to check with your OS
documentation for more information there.
--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orient�e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S�mard, 78210 St.-Cyr-l'�cole, France, +33 (0)1 30 23 00 34