Platform |
Win32, x64 |
Purpose |
To map a file to memory. |
Syntax |
INTEGER(7) FUNCTION MAP_FILE_FOR_READING@( FILENAME, SIZE ) |
Description |
When a file is memory mapped, a region of memory is defined so that accesses to that memory effectively access the disk file. A file may be opened for reading using MAP_FILE_FOR_READING@. FILENAME is the name of the file to be opened and SIZE is returned as the size of the file. Use the various Silverfrost CORE intrinsic functions to access the contents of the file. Any attempt to alter the contents of the file will cause an error. The memory can be unmapped by calling UNMAP_FILE@. |
Return value |
Returns the starting address of the mapped view or zero on failure |
Notes |
To call a routine with a mapped file as an argument use the form MYSUB(CCORE1(PTR)) where PTR is the value returned by MAP_FILE_FOR_READING@. |
See also |