Skip to content

Commit 75156f2

Browse files
committed
Add readonly volume open function
1 parent a575b3e commit 75156f2

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/volume_mgr.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,22 @@ where
102102
pub fn open_volume(
103103
&mut self,
104104
volume_idx: VolumeIdx,
105-
read_only: bool,
106105
) -> Result<Volume<D, T, MAX_DIRS, MAX_FILES, MAX_VOLUMES>, Error<D::Error>> {
107106
return self._open_volume(volume_idx, false);
108107
}
109108

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

0 commit comments

Comments
 (0)