Function fs_extra::dir::ls[][src]

pub fn ls<P>(path: P, config: &HashSet<DirEntryAttr>) -> Result<LsResult> where
    P: AsRef<Path>, 

Returned collection directory entries with information which you choose in config.

This function takes to arguments:

Errors

This function will return an error in the following situations, but is not limited to just these cases:

#Examples

extern crate fs_extra;
use fs_extra::dir::{ls, DirEntryAttr, LsResult};
use std::collections::HashSet;

let mut config = HashSet::new();
config.insert(DirEntryAttr::Name);
config.insert(DirEntryAttr::Size);
config.insert(DirEntryAttr::BaseInfo);

let result = ls("test", &config);
assert_eq!(2, ls_result.items.len());
assert_eq!(2, ls_result.base.len());