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

Function cp_file

src/init.rs:102–115  ·  view source on GitHub ↗

Copy file

(pname: &str, buffer: &[u8], v: bool)

Source from the content-addressed store, hash-verified

100
101// Copy file
102pub fn cp_file(pname: &str, buffer: &[u8], v: bool)
103{
104 if crate::fs::exists(pname)
105 {
106 return;
107 }
108
109 crate::fs::write(pname, buffer).ok();
110
111 if v
112 {
113 println!("[INFO] COPIED FILE: {}", pname);
114 }
115}
116
117
118// Create device

Callers

nothing calls this directly

Calls 2

existsFunction · 0.85
writeFunction · 0.50

Tested by

no test coverage detected