truncate

Function truncate 

Source
pub async fn truncate(path: impl AsRef<Path>, len: u64) -> Result<()>
Expand description

Truncate a file to the specified length.

If the file is larger, it will be truncated. If smaller, it will be extended with zeros.