(context: &Context, path: impl AsRef<Path>)
| 516 | } |
| 517 | |
| 518 | pub fn open_file_std(context: &Context, path: impl AsRef<Path>) -> Result<std::fs::File> { |
| 519 | let path_abs = get_abs_path(context, path.as_ref()); |
| 520 | |
| 521 | match std::fs::File::open(path_abs) { |
| 522 | Ok(bytes) => Ok(bytes), |
| 523 | Err(err) => { |
| 524 | warn!( |
| 525 | context, |
| 526 | "Cannot read \"{}\" or file is empty: {}", |
| 527 | path.as_ref().display(), |
| 528 | err |
| 529 | ); |
| 530 | Err(err.into()) |
| 531 | } |
| 532 | } |
| 533 | } |
| 534 | |
| 535 | /// Reads directory and returns a vector of directory entries. |
| 536 | pub async fn read_dir(path: &Path) -> Result<Vec<fs::DirEntry>> { |
nothing calls this directly
no test coverage detected