truncate
object at
offset
Object yields an object with an appropriate I/O manager. Offset yields an integer
.
The truncate
command truncates the specified object, which must be opened already with the open
command. In other words, any data after the specified offset is deleted. If no offset is specified, the object will be truncated where the last read
or write
left off.
If you open
a file that already exists and write
some data to it, the file may still contain old data that did not get overwritten. The truncate
command allows you to remove the contents of a file before writing to it.