Function fs_extra::dir::get_dir_content [] [src]

pub fn get_dir_content<P>(path: P) -> 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.


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.


Be careful when using this code, it's not being tested!
extern crate fs_extra;
use fs_extra::dir::get_dir_content;

let dir_content = get_dir_content("dir")?;
for directory in dir_content.directories {
    println!("{}", directory); // print directory path