Open a disk image file, returning a [`BlockError`] with path context on failure.
(path: &Path, options: &OpenOptions)
| 619 | /// Open a disk image file, returning a [`BlockError`] with path context |
| 620 | /// on failure. |
| 621 | pub fn open_disk_image(path: &Path, options: &OpenOptions) -> BlockResult<File> { |
| 622 | options.open(path).map_err(|e| { |
| 623 | BlockError::new(BlockErrorKind::Io, e) |
| 624 | .with_op(ErrorOp::Open) |
| 625 | .with_path(path) |
| 626 | }) |
| 627 | } |
| 628 | |
| 629 | /// Determine image type through file parsing. |
| 630 | pub fn detect_image_type(f: &mut File) -> BlockResult<ImageType> { |