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

Function set_executable

atomic-cli/src/commands/git/hooks.rs:519–525  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

517
518#[cfg(unix)]
519fn set_executable(path: &Path) -> io::Result<()> {
520 use std::os::unix::fs::PermissionsExt;
521
522 let mut permissions = fs::metadata(path)?.permissions();
523 permissions.set_mode(0o755);
524 fs::set_permissions(path, permissions)
525}
526
527#[cfg(not(unix))]
528fn set_executable(_path: &Path) -> io::Result<()> {

Callers 1

write_new_executableFunction · 0.85

Calls 3

set_permissionsFunction · 0.85
set_modeMethod · 0.80
permissionsMethod · 0.45

Tested by

no test coverage detected