C# Класс NetMud.DataAccess.FileSystem.FileAccessor

Показать файл Открыть проект

Открытые методы

Метод Описание
ArchiveDatedFile ( string fileName, string dateFormattedDirectory = "" ) : bool

Archives a file into a date formatted directory

ArchiveFile ( string currentFileName, string archiveFileName ) : bool

Rolls over a file using the default archive settings

ReadCurrentFileByPath ( string fileName ) : byte[]

Reads a file from the "current" directory by a filename

ReadFile ( FileInfo file ) : byte[]

Reads the contents of a file already opened

VerifyDirectory ( string directoryName, bool createIfMissing = true ) : bool

Verifies the existence of or creates a new directory, also creates the base directory if necessary

WriteToFile ( string fullFileName, byte bytes, FileMode writeMode = FileMode.Truncate ) : void

Writes a bytestream to a specific file

Описание методов

ArchiveDatedFile() публичный Метод

Archives a file into a date formatted directory
public ArchiveDatedFile ( string fileName, string dateFormattedDirectory = "" ) : bool
fileName string the file to roll over
dateFormattedDirectory string overrides the default DatedBackupDirectory setting
Результат bool

ArchiveFile() публичный Метод

Rolls over a file using the default archive settings
public ArchiveFile ( string currentFileName, string archiveFileName ) : bool
currentFileName string the file to be rolled over
archiveFileName string the filename to be rolled over to
Результат bool

ReadCurrentFileByPath() публичный Метод

Reads a file from the "current" directory by a filename
public ReadCurrentFileByPath ( string fileName ) : byte[]
fileName string the file to read in
Результат byte[]

ReadFile() публичный Метод

Reads the contents of a file already opened
public ReadFile ( FileInfo file ) : byte[]
file System.IO.FileInfo the file to read from
Результат byte[]

VerifyDirectory() публичный Метод

Verifies the existence of or creates a new directory, also creates the base directory if necessary
public VerifyDirectory ( string directoryName, bool createIfMissing = true ) : bool
directoryName string the directory to create
createIfMissing bool creates the directory if it doesn't already exist
Результат bool

WriteToFile() публичный Метод

Writes a bytestream to a specific file
public WriteToFile ( string fullFileName, byte bytes, FileMode writeMode = FileMode.Truncate ) : void
fullFileName string the fully qualified filename (with pathing)
bytes byte the data to write
writeMode FileMode should this file be overwritten or appended to
Результат void