Skip to main content
GameDev.net gamedev.net
🔒 Locked

Resizing a file stream ?

Started by Tylon Apr 12, 2002 at 5:46 AM 5 replies 650+ views
Original Post
Tylon
Tylon
oki, i have a binary read/write file open, and i want to ''erase'' some of the file and make it smaller. can anyone tell me how to do that? (in my specific case, i just want to delete everything after the file pointer, basically set the current pointer position to eof, and just delete everything after it)
Tylon
Tylon
well, i was hoping there was better way to do that, since the files in question are gonna be upto several hundred megs.

anyway, just for anyone interested, i have found a way to resize a file since my initial post. its done with functions _chsize (win) or truncate (linux).

yes it is possible
Tylon
Tylon
ah yeah, just noticed it takes a handle, good enough for me. os independancy is not an issue.
(although linux + windows would be enough portability for me anyway)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.