truncate_size


Description:

[ Version ( since = "1.0.77" ) ]
public bool truncate_size (string path, int64 size) throws Error

truncate a file to a particular size

This command truncates path to size size bytes. The file must exist already.

If the current file size is less than size then the file is extended to the required size with zero bytes. This creates a sparse file (ie. disk blocks are not allocated for the file until you write to it). To create a non-sparse file of zeroes, use fallocate64 instead.

Parameters:

this

A GuestfsSession object

Returns:

true on success, false on error




2022 vala-language.org