fn create(mut self, path: &str, filetype: FileType) -> Self {
        let path = Path::new(path);
        if path.is_absolute() {
            panic!("Only relative paths are allowed.");
        }
        if filetype == FileType::Dir {
            let _ = self.create_dir(path).unwrap();
        } else {
            if let Some(p) = path.parent() {
                let _ = self.create_dir(p).unwrap();
            } // else { assume that current dir exists }
            let _ = self.create_file(path, filetype).unwrap();
        }
        self
    }
/// Create a file or directory under the `path`
Create a file or directory under the `path`
Create a file or directory under the ` path `
fn create(mut self, path: &str, filetype: FileType) -> Self {
        let path = Path::new(path);
        if path.is_absolute() {
            panic!("Only relative paths are allowed.");
        }
        if filetype == FileType::Dir {
            let _ = self.create_dir(path).unwrap();
        } else {
            if let Some(p) = path.parent() {
                let _ = self.create_dir(p).unwrap();
            } // else { assume that current dir exists }
            let _ = self.create_file(path, filetype).unwrap();
        }
        self
    }
fn create ( mut self , path : & str , filetype : FileType ) -> Self { let path = Path :: new ( path ) ; if path . is_absolute ( ) { panic ! ( " " ) ; } if filetype == FileType :: Dir { let _ = self . create_dir ( path ) . unwrap ( ) ; } else { if let Some ( p ) = path . parent ( ) { let _ = self . create_dir ( p ) . unwrap ( ) ; } // else { assume that current dir exists } let _ = self . create_file ( path , filetype ) . unwrap ( ) ; } self }
Create a file or directory under the `path`
Create a file or directory under the ` path `
mut self
path
&str
filetype
FileType
mut self
path
&str
filetype
FileType