Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

(How do )I set EOF to an ofstream obj

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
I wish to use ofstream::seekp() to point and set
there the new EOF, but...

I tried:
{
ofstream o("blah.txt", ios::in | ios::eek:ut);

o.seekp(-30L, ios::end);
//set the ptr 30 bytes back from EOF.
//I want to set (the new) EOF HERE!
}
10x.
 
Joe, maybe he/she wants to truncate file? I don't know how to do it, but is possible by copying needed amount of data in other file and remove or leave the old one. John Fill
1c.bmp


ivfmd@mail.md
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top