/// Opens a file, creating it if it doesn't exist
Opens a file, creating it if it doesn't exist
Opens a file creating it if it doesn ' t exist
pub fn touch(path: &Path) -> io::Result<File> {
    if !path.is_file() {
        if let Some(basedir) = path.parent() {
            create_dir_all(basedir)?;
        }
        File::create(path)?;
    }
    File::open(path)
}
pub fn touch ( path : & Path ) -> io :: Result < File > { if ! path . is_file ( ) { if let Some ( basedir ) = path . parent ( ) { create_dir_all ( basedir ) ? ; } File :: create ( path ) ? ; } File :: open ( path ) }
Opens a file, creating it if it doesn't exist
Opens a file creating it if it doesn ' t exist
path
&Path