Hello,
Does anyone knows how to truncate a file ?
I took a function from kernel32.dll :
SetEndOfFile%(hFile%):"SetEndOfFile"
however it doesn't work.
I tried that :
My file "i:\test.dat" is 100000 bytes long, even after running this code (and SetEndOfFile return 0, which means failure).
MSDN says "The SetEndOfFile function sets the physical file size for the specified file to the current position of the file pointer." so I guess the problem is maybe because the OpenFile handler is Blitz-specific.
Anyone knows how to get the real file handler in this case ?
Does anyone knows how to truncate a file ?
I took a function from kernel32.dll :
SetEndOfFile%(hFile%):"SetEndOfFile"
however it doesn't work.
I tried that :
test = OpenFile("i:\test.dat") SeekFile test, 4096 Notify(SetEndOfFile(test)) CloseFile test
My file "i:\test.dat" is 100000 bytes long, even after running this code (and SetEndOfFile return 0, which means failure).
MSDN says "The SetEndOfFile function sets the physical file size for the specified file to the current position of the file pointer." so I guess the problem is maybe because the OpenFile handler is Blitz-specific.
Anyone knows how to get the real file handler in this case ?