MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / write_file

Method write_file

atomic-core/src/output/memory.rs:674–686  ·  view source on GitHub ↗
(&self, path: &str, inode: Inode)

Source from the content-addressed store, hash-verified

672 }
673
674 fn write_file(&self, path: &str, inode: Inode) -> Result<Self::Writer, Self::Error> {
675 // Ensure parent directory exists
676 if let Some(parent) = path_parent(path) {
677 self.ensure_directories(&parent);
678 }
679
680 Ok(MemoryWriter {
681 path: path.to_string(),
682 buffer: Cursor::new(Vec::new()),
683 files: &self.files as *const RefCell<HashMap<String, MemoryFile>>,
684 inode,
685 })
686 }
687}
688
689// HELPER FUNCTIONS

Callers 3

test_write_fileFunction · 0.45

Calls 2

path_parentFunction · 0.85
ensure_directoriesMethod · 0.80

Tested by 3

test_write_fileFunction · 0.36