(
dir: &std::path::Path,
name: &str,
mode: u32,
content: &[u8],
)
| 72 | /// Create a regular file with given mode (Unix) or default perms (non-Unix). |
| 73 | #[cfg(unix)] |
| 74 | fn make_key_file( |
| 75 | dir: &std::path::Path, |
| 76 | name: &str, |
| 77 | mode: u32, |
| 78 | content: &[u8], |
| 79 | ) -> std::path::PathBuf { |
| 80 | let path = dir.join(name); |
| 81 | let mut f = std::fs::File::create(&path).unwrap(); |
| 82 | f.write_all(content).unwrap(); |
| 83 | drop(f); |
| 84 | std::fs::set_permissions(&path, std::fs::Permissions::from_mode(mode)).unwrap(); |
| 85 | path |
| 86 | } |
| 87 | |
| 88 | #[tokio::test] |
| 89 | #[cfg(unix)] |
no test coverage detected