(path: &Path, content: &[u8])
| 492 | } |
| 493 | |
| 494 | fn 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 | |
| 502 | fn replace_owned_executable(path: &Path, content: &[u8]) -> io::Result<()> { |
| 503 | let parent = path.parent().ok_or_else(|| { |
no test coverage detected