Mail Archives: djgpp/1998/08/11/18:15:52
Peter Danielsson wrote:
> I want to change the first byte in a file using fstream. If i use
> fil.open then fil.write(&ch,1) then fil.close() I get a 1byte large file
> only including ch. What can I do??
>
> /Peter
Try this:
fstream File(Filename, ios::app);
File.seekp(0,ios::beg);
File.write("a",1);
File.close();
I think there is a way to open a file so that it starts at 0 but is not
truncated, but I don't know how. There is a enum for it "ios::trunc" but
that seems to be the default, I wonder how you can unset that?
--
(\/) Endlisnis (\/)
s257m AT unb DOT ca
Endlisnis AT GeoCities DOT com
Endlis AT nbnet DOT nb DOT ca
- Raw text -