Function get_file_size

Source
fn get_file_size(file: &File) -> Result<u64>
Expand description

Get total size in bytes of the given file.

If the file is a block or character device, use get_device_size() instead of reading len from metadata which doesn’t work on some platforms like macOS.