MCPcopy Create free account
hub / github.com/assert-rs/assert_fs / write_binary

Function write_binary

src/fixture/tools.rs:309–315  ·  view source on GitHub ↗
(path: &path::Path, data: &[u8])

Source from the content-addressed store, hash-verified

307}
308
309fn write_binary(path: &path::Path, data: &[u8]) -> Result<(), FixtureError> {
310 ensure_parent_dir(path)?;
311 let mut file = fs::File::create(path).chain(FixtureError::new(FixtureKind::WriteFile))?;
312 file.write_all(data)
313 .chain(FixtureError::new(FixtureKind::WriteFile))?;
314 Ok(())
315}
316
317fn write_str(path: &path::Path, data: &str) -> Result<(), FixtureError> {
318 ensure_parent_dir(path)?;

Callers 2

write_binaryMethod · 0.85
write_strFunction · 0.85

Calls 2

ensure_parent_dirFunction · 0.85
chainMethod · 0.80

Tested by

no test coverage detected