Function rfm::touch [−][src]
pub fn touch(file_paths: &Vec<&PathBuf>) -> Result<()>
Expand description
Creates a file/files in the passed path.
file_paths - takes a list of paths of what you want to create.
Errors
This function will return an error in the following situations, but is not limited to just these case:
- Param
file_pathscontains file or directory does not exist. - Param
file_pathscontains file or directory with invalid name. - The current process does not have the permission to access to input params.
Example
ⓘ
extern crate rfm; use rfm::touch; let file_1 = std::path::Path::new("./file-1.txt").to_path_buf(); let file_2 = std::path::Path::new("./file-2.txt").to_path_buf(); let files: Vec<&std::path::PathBuf> = vec![&file_1, &file_2]; touch(&files)?;