CreateFile() публичный статический Метод

Creates a DiskMedium from a stream. This will initialize the stream as an empty file structure.
This will not check if the file is truely a new file. If calling this with an existing archive file, it will overwrite the table of contents, corrupting the file.
public static CreateFile ( CustomFileStream stream, MemoryPool pool, int fileStructureBlockSize ) : DiskMedium
stream CustomFileStream An open to use. The /// will assume ownership of this .
pool GSF.IO.Unmanaged.MemoryPool the to allocate data from
fileStructureBlockSize int the block size of the file structure. Usually 4kb.
Результат DiskMedium
Пример #1
0
        public static DiskIo CreateFile(string fileName, MemoryPool pool, int fileStructureBlockSize, params Guid[] flags)
        {
            //Exclusive opening to prevent duplicate opening.
            CustomFileStream fileStream = CustomFileStream.CreateFile(fileName, pool.PageSize, fileStructureBlockSize);
            DiskMedium       disk       = DiskMedium.CreateFile(fileStream, pool, fileStructureBlockSize, flags);

            return(new DiskIo(disk, false));
        }