MCPcopy Index your code
hub / github.com/endbasic/endbasic / put

Method put

std/src/storage/fs.rs:109–114  ·  view source on GitHub ↗
(&mut self, name: &str, content: &[u8])

Source from the content-addressed store, hash-verified

107 }
108
109 async fn put(&mut self, name: &str, content: &[u8]) -> io::Result<()> {
110 let path = self.dir.join(name);
111 let mut output = OpenOptions::new().create(true).write(true).truncate(true).open(path)?;
112 output.write_all(content)?;
113 output.sync_all()
114 }
115
116 fn system_path(&self, name: &str) -> Option<PathBuf> {
117 Some(self.dir.join(name))

Callers 1

test_directorydrive_putFunction · 0.45

Calls 2

writeMethod · 0.45
createMethod · 0.45

Tested by 1

test_directorydrive_putFunction · 0.36