MCPcopy Create free account
hub / github.com/bendudson/EuraliOS / mkdir

Function mkdir

shell/src/main.rs:139–150  ·  view source on GitHub ↗

Make a directory

(current_directory: &Path, args: &[&str])

Source from the content-addressed store, hash-verified

137
138/// Make a directory
139fn mkdir(current_directory: &Path, args: &[&str]) {
140 if args.len() != 1 {
141 println!("Usage: mkdir <directory>");
142 return;
143 }
144 let arg = args.first().unwrap();
145 let path = fs::canonicalize(PathBuf::from(current_directory).join(arg)).unwrap();
146 if let Err(err) = fs::create_dir(path) {
147 // Failed
148 println!("mkdir: cannot create {}: {:?}", arg, err);
149 }
150}
151
152#[no_mangle]
153fn main() {

Callers 1

mainFunction · 0.85

Calls 4

canonicalizeFunction · 0.85
create_dirFunction · 0.85
joinMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected