Skip to content

Commit

Permalink
add interface to create a directory
Browse files Browse the repository at this point in the history
  • Loading branch information
stlankes committed May 26, 2024
1 parent c94bb91 commit ae7115f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/fs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,15 @@ pub unsafe fn create_file(
}
}

/// Returns an vectri with all the entries within a directory.
/// Creates a new, empty directory at the provided path
pub fn create_dir(path: &str) -> Result<(), IoError> {
FILESYSTEM
.get()
.unwrap()
.mkdir(path, AccessPermission::from_bits(0o777).unwrap())
}

/// Returns an vector with all the entries within a directory.
pub fn readdir(name: &str) -> Result<Vec<DirectoryEntry>, IoError> {
debug!("Read directory {}", name);

Expand Down

0 comments on commit ae7115f

Please sign in to comment.