MemoryMappedFile.CreateOrOpen Method (String, Int64, MemoryMappedFileAccess)
Creates or opens a memory-mapped file that has the specified capacity and access type in system memory.
Assembly: System.Core (in System.Core.dll)
public static MemoryMappedFile CreateOrOpen( string mapName, long capacity, MemoryMappedFileAccess access )
A name to assign to the memory-mapped file.
The maximum size, in bytes, to allocate to the memory-mapped file.
One of the enumeration values that specifies the type of access allowed to the memory-mapped file. The default is ReadWrite.
Return ValueType: System.IO.MemoryMappedFiles.MemoryMappedFile
A memory-mapped file that has the specified characteristics.
mapName is an empty string.
access is set to write-only with the Write enumeration value.
mapName is null.
capacity is greater than the size of the logical address space.
capacity is less than or equal to zero.
access is not a valid MemoryMappedFileAccess enumeration value.
Use this method to create or open a memory-mapped file that is not persisted (that is, not associated with a file on disk), which you can use to share data between processes.
Available since 4.0