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

Function write_new_synced

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

Source from the content-addressed store, hash-verified

5012}
5013
5014pub(super) fn write_new_synced(path: &Path, bytes: &[u8]) -> Result<(), RepositoryError> {
5015 let mut file = OpenOptions::new().write(true).create_new(true).open(path)?;
5016 file.write_all(bytes)?;
5017 file.sync_all()?;
5018 Ok(())
5019}
5020
5021fn write_atomic_regular(path: &Path, bytes: &[u8], mode: u32) -> Result<(), RepositoryError> {
5022 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