Method
open_backing_file
(
backing_file: &PathBuf,
file_offset: u64,
shared: bool,
)
Source from the content-addressed store, hash-verified
| 1880 | } |
| 1881 | |
| 1882 | fn open_backing_file( |
| 1883 | backing_file: &PathBuf, |
| 1884 | file_offset: u64, |
| 1885 | shared: bool, |
| 1886 | ) -> Result<FileOffset, Error> { |
| 1887 | if backing_file.is_dir() { |
| 1888 | Err(Error::DirectoryAsBackingFileForMemory) |
| 1889 | } else { |
| 1890 | let f = OpenOptions::new() |
| 1891 | .read(true) |
| 1892 | .write(shared) |
| 1893 | .open(backing_file) |
| 1894 | .map_err(Error::SharedFileCreate)?; |
| 1895 | |
| 1896 | Ok(FileOffset::new(f, file_offset)) |
| 1897 | } |
| 1898 | } |
| 1899 | |
| 1900 | #[allow(clippy::too_many_arguments)] |
| 1901 | pub fn create_ram_region_raw( |
Callers
nothing calls this directly
Tested by
no test coverage detected