(path: &Path)
| 1071 | /// O_DIRECTORY cannot slip a special file through. |
| 1072 | #[cfg(unix)] |
| 1073 | fn open_dir_no_follow(path: &Path) -> Result<(), std::io::Error> { |
| 1074 | let file = std::fs::OpenOptions::new() |
| 1075 | .read(true) |
| 1076 | .custom_flags(OPEN_NO_FOLLOW | OPEN_DIRECTORY) |
| 1077 | .open(path)?; |
| 1078 | if !file.metadata()?.is_dir() { |
| 1079 | return Err(std::io::Error::new( |
| 1080 | std::io::ErrorKind::Unsupported, |
| 1081 | format!( |
| 1082 | "event journal ancestor '{}' is not a directory", |
| 1083 | path.display() |
| 1084 | ), |
| 1085 | )); |
| 1086 | } |
| 1087 | Ok(()) |
| 1088 | } |
| 1089 | |
| 1090 | #[cfg(not(unix))] |
| 1091 | fn open_dir_no_follow(path: &Path) -> Result<(), std::io::Error> { |
no test coverage detected