Page 1 of 1

Posted: Mon Mar 31, 2003 4:40 pm
by BackupUser
Restored from previous forum. Originally posted by horst.

Shouldn't there be a built-in function to set the end of file
(i.e. truncate an existing file)?

API:
SetEndOfFile_(UseFile(file#))


Horst

Posted: Thu Apr 03, 2003 9:12 am
by BackupUser
Restored from previous forum. Originally posted by Amiga5k.

Hmm... You could set the EOF by changing the length of the file in various ways (rewrite it). EOF, AFAIK, is an OS function that returns true if it is, indeed, the end of the file. It wouldn't make sense to have an EOF somewhere in the middle [:/]

Russell

***Commodore 64 - Over one million cycles per second, 16 vibrant colors, 3 incredible audio channels and 38,911 Basic Bytes Free! Who could ask for anything more?***

Posted: Thu Apr 03, 2003 10:43 am
by BackupUser
Restored from previous forum. Originally posted by freak.

What he wants is make the file shorter, without rewriting it. You can make the file longer, if you write something behind it's end, but there is currently no function for the opposite.

That is what the SetEndOfFile_() API does, it set's the End of the File to the current position (set by FileSeek() for example), so everything after the current position will be deleeted.

Timo

Posted: Fri Apr 04, 2003 9:18 pm
by BackupUser
Restored from previous forum. Originally posted by Amiga5k.

Ah, my mistake The only thing I would say about this command is "Use with extreme caution!"

Russell

***Commodore 64 - Over one million cycles per second, 16 vibrant colors, 3 incredible audio channels and 38,911 Basic Bytes Free! Who could ask for anything more?***