-
Well since no one did found out the answer, last time i asked this, how do you shorten a file without having to rewrite it again?
In example a 50M file would take about 15 seconds to remove the last 1 byte, not too impressive. I'm sure it can be done, maybe not in vb but in C++ or something.
Thanks.
-
Why?
Kedaman why can't you overwrite the file? just wondering, and what are you trying to do???? :)
Later(z)
REM
-
Well, actually it's just mp3's that are from 3-5M but it costs a second and on slower machines up to 10 sec. I've posted this earlier but nobody did know. Now I hope someone knows, and i know it must be some way of doing it
-
I'm trying to find the same answer, it seems it might be possible if you open it and work it via API calls, then there is a function:
Private Declare Function SetEndOfFile Lib "kernel32" (ByVal hFile As Long) As Long
That can do it, the trick is converting a Filenumber to a file handle
-
FindFirstFile(...) will give you a filehandle...
ReadFile(...) will allow you to go to the position where you want to set the EndofFile.
SetEndofFile(...) will set the end of the file to be that position that you read to (AFAIK).
Rember to use FindClose(...) when done w/the handle.