MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / write_file

Method write_file

src/storage.rs:460–468  ·  view source on GitHub ↗
(path: &Path, contents: &[u8])

Source from the content-addressed store, hash-verified

458 }
459
460 pub fn write_file(path: &Path, contents: &[u8]) -> io::Result<()> {
461 if let Some(parent) = path.parent() {
462 Self::create_dir_all(parent)?;
463 }
464 reject_symlink_components(path, "private store file")?;
465 Self::open_private(path, fs::OpenOptions::new().write(true).truncate(true))?
466 .write_all(contents)?;
467 set_private_file_permissions(path)
468 }
469
470 /// Appends one line via a single `O_APPEND` write so concurrent hook
471 /// processes never interleave partial lines or lose each other's entries

Callers

nothing calls this directly

Calls 3

writeMethod · 0.45

Tested by

no test coverage detected