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

Function write_new_synced

atomic-repository/src/repository/operation.rs:5018–5023  ·  view source on GitHub ↗
(path: &Path, bytes: &[u8])

Source from the content-addressed store, hash-verified

5016}
5017
5018pub(super) fn write_new_synced(path: &Path, bytes: &[u8]) -> Result<(), RepositoryError> {
5019 let mut file = OpenOptions::new().write(true).create_new(true).open(path)?;
5020 file.write_all(bytes)?;
5021 file.sync_all()?;
5022 Ok(())
5023}
5024
5025fn write_atomic_regular(path: &Path, bytes: &[u8], mode: u32) -> Result<(), RepositoryError> {
5026 let parent = path

Callers 5

retain_current_indexMethod · 0.85
write_atomic_gitlinkFunction · 0.85

Calls 2

openMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected