User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

ftruncate [2006/10/06 19:08] (current)
Line 1: Line 1:
 +# $EPIC: ftruncate.txt,​v 1.2 2006/10/06 19:08:28 jnelson Exp $
 +$[[ftruncate]](//​bytes//​ //​filename//​)
 +The [[ftruncate]] file causes the //​filename//​ to change to exactly //bytes//
 +bytes in size.  The file is grown or shrunk as necessary. ​ If the file is
 +shrunk, the data beyond the new file size is irretrievably lost.  If the file
 +is grown, the contents of the new space is unspecified,​ but usually it is 
 +nuls (ascii 0).
 +If the operation succeeds, the empty string is returned. ​ If the operation
 +fails, an error string is returned, suitable for [[echo]]ing.
 +This is useful for clearing a logfile that has gotten too big.
 +The empty string on success, or an error string on failure.
ftruncate.txt ยท Last modified: 2006/10/06 19:08 (external edit)