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

Method open

src/fs/file.rs:87–104  ·  view source on GitHub ↗

Open

(pname: &str)

Source from the content-addressed store, hash-verified

85
86 // Open
87 pub fn open(pname: &str) -> Option<Self>
88 {
89 let pname = rpath(pname);
90 let dname = dname(&pname);
91 let fname = fname(&pname);
92
93 if let Some(directory) = Directory::open(dname)
94 {
95 if let Some(directory_entry) = directory.find(fname)
96 {
97 if directory_entry.isfile()
98 {
99 return Some(directory_entry.into());
100 }
101 }
102 }
103 None
104 }
105
106
107 // Read to string

Callers

nothing calls this directly

Calls 7

rpathFunction · 0.85
dnameFunction · 0.85
fnameFunction · 0.85
isfileMethod · 0.80
intoMethod · 0.80
openFunction · 0.70
findMethod · 0.45

Tested by

no test coverage detected