pub fn truncate<P: AsRef<Path>>(
file: P,
options: &Options,
) -> Result<u64, Error>
Expand description
Shrink or extend the size of a file to the specified size.
Shrink or extend the size of file to the specified size.
file
argument that does not exist is created.
If file
is larger than the specified size, the extra data is lost.
If file
is shorter, it is extended and the sparse extended part (hole) reads as zero bytes.
Mandatory arguments to long options are mandatory for short options too.