Function fs_extra::dir::get_size [−][src]
pub fn get_size<P>(path: P) -> Result<u64> where
P: AsRef<Path>,
Returns the size of the file or directory
Errors
This function will return an error in the following situations, but is not limited to just these cases:
- This
path
directory does not exist. - Invalid
path
. - The current process does not have the permission rights to access
path
.
Examples
ⓘ
extern crate fs_extra; use fs_extra::dir::get_size; let folder_size = get_size("dir")?; println!("{}", folder_size); // print directory sile in bytes