[][src]Function filesize::file_real_size_fast

pub fn file_real_size_fast<P: AsRef<Path>>(
    path: P,
    metadata: &Metadata
) -> Result<u64>

Get the on-disk size of the file at the given path, using a reference to a previously-fetched Metadata struct if necessary.

This avoids an unnecessary stat() call on Unix if Metadata has already been retrieved.

let realsize = filesize::file_real_size_fast(
    "Cargo.toml",
     &std::fs::symlink_metadata("Cargo.toml")?
)?;