Talk:Truncate a file: Difference between revisions

From Rosetta Code
Content added Content deleted
(Just making sure...)
 
(truncate())
Line 1: Line 1:
So just to be sure, if the actual file size is smaller than the given truncated size, it's an error? It doesn't just leave the file alone? --[[User:Mwn3d|Mwn3d]] 14:09, 19 July 2011 (UTC)
So just to be sure, if the actual file size is smaller than the given truncated size, it's an error? It doesn't just leave the file alone? --[[User:Mwn3d|Mwn3d]] 14:09, 19 July 2011 (UTC)
:POSIX truncate() and ftruncate() extends the file if specified size is larger than original. It's convenient when you want to reserve some disk space. --[[User:Ledrug|Ledrug]] 14:25, 19 July 2011 (UTC)

Revision as of 14:25, 19 July 2011

So just to be sure, if the actual file size is smaller than the given truncated size, it's an error? It doesn't just leave the file alone? --Mwn3d 14:09, 19 July 2011 (UTC)

POSIX truncate() and ftruncate() extends the file if specified size is larger than original. It's convenient when you want to reserve some disk space. --Ledrug 14:25, 19 July 2011 (UTC)