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

Function write

src/fs/mod.rs:427–438  ·  view source on GitHub ↗

Write

(path: &str, buffer: &[u8])

Source from the content-addressed store, hash-verified

425
426// Write
427pub fn write(path: &str, buffer: &[u8]) -> Result<usize, ()>
428{
429 if let Some(handle) = new_file(&path)
430 {
431 if let Some(bytes) = crate::sys::sc::write(handle, buffer)
432 {
433 crate::sys::sc::close(handle);
434 return Ok(bytes);
435 }
436 }
437 Err(())
438}

Callers 1

dev_newFunction · 0.70

Calls 3

new_fileFunction · 0.85
closeFunction · 0.85
ErrEnum · 0.50

Tested by

no test coverage detected