MCPcopy Create free account
hub / github.com/LibertyOS-Development/kernel / create

Method create

src/fs/directory.rs:34–48  ·  view source on GitHub ↗

Create new directory

(pname: &str)

Source from the content-addressed store, hash-verified

32
33 // Create new directory
34 pub fn create(pname: &str) -> Option<Self>
35 {
36 let pname = rpath(pname);
37 let dname = crate::fs::dname(&pname);
38 let fname = crate::fs::fname(&pname);
39
40 if let Some(directory) = Directory::open(dname)
41 {
42 if let Some(directory_entry) = directory.new_dir(fname)
43 {
44 return Some(directory_entry.into());
45 }
46 }
47 None
48 }
49
50
51 // Find

Callers

nothing calls this directly

Calls 6

rpathFunction · 0.85
dnameFunction · 0.85
fnameFunction · 0.85
new_dirMethod · 0.80
intoMethod · 0.80
openFunction · 0.70

Tested by

no test coverage detected