Chris Siebern
2010-03-29 21:58:06 UTC
Abstract:
Creating multiple memmapfile object in a single binary file. Can read the first one no issues, reading the second errors out,"file being used by another process." How can I map discontinuous sections of a file? Yes i verified I have closed the file with fclose(fid);.
Detailed:
I have written a function that creates 2 memmapfile objects from the same source file. The binary file has 3 distinct sections. Header, variable length record, and the data. I need map the header and the data.
The first memmapfile object is the file header which is 227 bytes long. The second memmap object skips the variable length record using the offset to the data from the header to get to the necessary data section and maps the data structure.
I can read the header without issues. However when I read from the second memmapfile object to get query the data, I get the following error:
EDU>> LasData.Data
??? Error using ==> hMapFile
Cannot map file "C:\Documents and Settings\csiebern\My Documents\Purdue\CE597 GIS\CE597 Term Project\000007.las": The process
cannot access the file because it is being used by another process.
Error in ==> memmapfile.memmapfile>memmapfile.hCreateMap at 273
hMapFile(mapfileInputStruct);
Error in ==> memmapfile.memmapfile>memmapfile.subsref at 623
hCreateMap(obj);
The diagram in the help documentation suggests that multiple memmap objects can exist for the same file. I'm not sure what my issue is.
Creating multiple memmapfile object in a single binary file. Can read the first one no issues, reading the second errors out,"file being used by another process." How can I map discontinuous sections of a file? Yes i verified I have closed the file with fclose(fid);.
Detailed:
I have written a function that creates 2 memmapfile objects from the same source file. The binary file has 3 distinct sections. Header, variable length record, and the data. I need map the header and the data.
The first memmapfile object is the file header which is 227 bytes long. The second memmap object skips the variable length record using the offset to the data from the header to get to the necessary data section and maps the data structure.
I can read the header without issues. However when I read from the second memmapfile object to get query the data, I get the following error:
EDU>> LasData.Data
??? Error using ==> hMapFile
Cannot map file "C:\Documents and Settings\csiebern\My Documents\Purdue\CE597 GIS\CE597 Term Project\000007.las": The process
cannot access the file because it is being used by another process.
Error in ==> memmapfile.memmapfile>memmapfile.hCreateMap at 273
hMapFile(mapfileInputStruct);
Error in ==> memmapfile.memmapfile>memmapfile.subsref at 623
hCreateMap(obj);
The diagram in the help documentation suggests that multiple memmap objects can exist for the same file. I'm not sure what my issue is.