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

Function remove_if_present

atomic-repository/src/repository/database.rs:233–238  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

231}
232
233fn remove_if_present(path: &Path) -> Result<(), RepositoryError> {
234 match std::fs::remove_file(path) {
235 Err(error) if error.kind() != std::io::ErrorKind::NotFound => Err(error.into()),
236 _ => Ok(()),
237 }
238}
239
240/// Make renames in `dir` durable. Directory fsync is only portable on Unix;
241/// elsewhere the renames are still atomic.

Callers 1

merge_legacyFunction · 0.70

Calls 1

kindMethod · 0.45

Tested by

no test coverage detected