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

Method open

src/fs/dev.rs:63–81  ·  view source on GitHub ↗

Open

(pname: &str)

Source from the content-addressed store, hash-verified

61
62 // Open
63 pub fn open(pname: &str) -> Option<Self>
64 {
65 let pname = rpath(pname);
66 let dname = crate::fs::dname(&pname);
67 let fname = fname(&pname);
68 if let Some(directory) = Directory::open(dname)
69 {
70 if let Some(directory_entry) = directory.find(fname)
71 {
72 if directory_entry.isdev()
73 {
74 let blk = LinkBlk::read(directory_entry.address());
75 let data = blk.data();
76 return Some(Self::new(data[0]));
77 }
78 }
79 }
80 None
81 }
82}
83
84

Callers

nothing calls this directly

Calls 9

rpathFunction · 0.85
dnameFunction · 0.85
fnameFunction · 0.85
isdevMethod · 0.80
dataMethod · 0.80
openFunction · 0.70
readFunction · 0.70
findMethod · 0.45
addressMethod · 0.45

Tested by

no test coverage detected