Function lrs::file::set_len

Truncates a file to a certain length.

Syntax

fn set_len<P>(path: P, len: u64) -> Result<(), Errno>
    where P: ToCString,

Arguments

NameDescription
path

The path of the file to be truncated.

len

The length we want to truncate the file to.

Remarks

The new length can be larger than the old length.

If the path is relative, it will be interpreted relative to the current working directory.

See also