Skip to content

Commit

Permalink
Add readonly volume open function
Browse files Browse the repository at this point in the history
  • Loading branch information
Murmele committed May 30, 2024
1 parent a575b3e commit 75156f2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/volume_mgr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,22 @@ where
pub fn open_volume(
&mut self,
volume_idx: VolumeIdx,
read_only: bool,
) -> Result<Volume<D, T, MAX_DIRS, MAX_FILES, MAX_VOLUMES>, Error<D::Error>> {
return self._open_volume(volume_idx, false);
}

/// Get a read only volume (or partition) based on entries in the Master Boot Record.
/// Opening and closing a read only volume is faster than a writable volume.
///
/// We do not support GUID Partition Table disks. Nor do we support any
/// concept of drive letters - that is for a higher layer to handle.
pub fn open_volume_read_only(
&mut self,
volume_idx: VolumeIdx,
) -> Result<Volume<D, T, MAX_DIRS, MAX_FILES, MAX_VOLUMES>, Error<D::Error>> {
return self._open_volume(volume_idx, true);
}

/// Get a volume (or partition) based on entries in the Master Boot Record.
///
/// We do not support GUID Partition Table disks. Nor do we support any
Expand Down

0 comments on commit 75156f2

Please sign in to comment.