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

Method create

src/fs/file.rs:45–59  ·  view source on GitHub ↗

Create

(pname: &str)

Source from the content-addressed store, hash-verified

43
44 // Create
45 pub fn create(pname: &str) -> Option<Self>
46 {
47 let pname = rpath(pname);
48 let dname = dname(&pname);
49 let fname = fname(&pname);
50
51 if let Some(directory) = Directory::open(dname)
52 {
53 if let Some(directory_entry) = directory.new_file(fname)
54 {
55 return Some(directory_entry.into());
56 }
57 }
58 None
59 }
60
61
62 // Delete

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected