Home All Groups Group Topic Archive Search About
Author
7 Mar 2006 10:56 PM
leibnizster
Hello,

I have a 4 GB file and I want to truncate it to, say, 3.8. Cany I do
something like seek to some byte in the file and then delete all the
bytes that come after that? If yes how?

Thanks

Author
7 Mar 2006 11:26 PM
leibnizster
if anyone cares, I used interop with the function:
SetEndOfFile()
Author
8 Mar 2006 7:40 AM
Jon Skeet [C# MVP]
<leibnizs***@gmail.com> wrote:
> if anyone cares, I used interop with the function:
> SetEndOfFile()

You didn't need to do that. Just use FileStream.SetLength.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

AddThis Social Bookmark Button