Function fs_extra::dir::get_dir_content2 [−][src]
pub fn get_dir_content2<P>(path: P, options: &DirOptions) -> Result<DirContent> where
P: AsRef<Path>,
Return DirContent which containt information about directory:
- Size directory.
- List all files source directory(files subdirectories included too).
- List all directory and subdirectories source path.
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_dir_content2; let options = DirOptions::new(); options.depth = 3; // Get 3 levels of folder. let dir_content = get_dir_content2("dir", &options)?; for directory in dir_content.directories { println!("{}", directory); // print directory path }