Truncates a file to a certain length.
fn set_len<P>(path: P, len: u64) -> Result<(), Errno>
where P: ToCString,| Name | Description |
|---|---|
| path | The path of the file to be truncated. |
| len | The length we want to truncate the file to. |
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.