SIL.FieldWorks.FDO.Infrastructure.Impl.SharedXMLBackendProvider.CreateOrOpen C# (CSharp) Метод

CreateOrOpen() приватный Метод

private CreateOrOpen ( string name, long capacity, bool createdNew ) : MemoryMappedFile
name string
capacity long
createdNew bool
Результат System.IO.MemoryMappedFiles.MemoryMappedFile
		private MemoryMappedFile CreateOrOpen(string name, long capacity, bool createdNew)
		{
#if __MonoCS__
			name = Path.Combine(m_commitLogDir, name);
			// delete old file that could be left after a crash
			if (createdNew && File.Exists(name))
				File.Delete(name);

			// Mono only supports memory mapped files that are backed by an actual file
			if (!File.Exists(name))
			{
				using (var fs = new FileStream(name, FileMode.CreateNew))
					fs.SetLength(capacity);
			}
#endif
			return MemoryMappedFile.CreateOrOpen(name, capacity);
		}