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

Function write_new_executable

atomic-cli/src/commands/git/hooks.rs:494–500  ·  view source on GitHub ↗
(path: &Path, content: &[u8])

Source from the content-addressed store, hash-verified

492}
493
494fn write_new_executable(path: &Path, content: &[u8]) -> io::Result<()> {
495 let mut file = OpenOptions::new().write(true).create_new(true).open(path)?;
496 file.write_all(content)?;
497 file.sync_all()?;
498 set_executable(path)?;
499 Ok(())
500}
501
502fn replace_owned_executable(path: &Path, content: &[u8]) -> io::Result<()> {
503 let parent = path.parent().ok_or_else(|| {

Callers 2

replace_owned_executableFunction · 0.85

Calls 3

set_executableFunction · 0.85
openMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected