[][src]Function rfm::ls

pub fn ls(dir: &PathBuf) -> Result<Vec<PathBuf>>

Read the directory/directories and return the content. dir - takes the path to the directory whose contents you want to retrieve.

Errors

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

  • Param dir contains file or directory does not exist.
  • Param dir contains file or directory with invalid name.
  • The current process does not have the permission to access to input params.

Example

ⓘThis example is not tested
 extern crate rfm;
 use rfm::ls;

 let dir = std::path::Path::new("./dir1").to_path_buf();

 let directory_contents = ls(&dir)?;