public class QuickIOFileInfo : QuickIOFileSystemEntryBase
Provides properties and instance methods for files
QuickIOFileInfo(QuickIOPathInfo pathInfo)
Create new instance of QuickIOFileInfo
public void QuickIOFileInfo(QuickIOPathInfo pathInfo)
QuickIOFileInfo(QuickIOPathInfo pathInfo, Win32FindData win32FindData)
Creates the file information on the basis of the path and Win32FindData
internal void QuickIOFileInfo(QuickIOPathInfo pathInfo, Win32FindData win32FindData)
Parameters
pathInfo
QuickIOPathInfoFull path to the file
win32FindData
Win32FindDataWin32FindData
QuickIOFileInfo(String path)
Create new instance of QuickIOFileInfo
public void QuickIOFileInfo(String path)
QuickIOFileInfo(String fullName, Win32FindData win32FindData)
Creates the file information on the basis of the path and Win32FindData
internal void QuickIOFileInfo(String fullName, Win32FindData win32FindData)
Parameters
fullName
StringFull path to the file
win32FindData
Win32FindDataWin32FindData
AppendAllLines(IEnumerable contents)
Appends lines to a file. Uses UTF-8 Encoding.
public void AppendAllLines(IEnumerable contents)
Parameters
contents
IEnumerableThe lines to append.
AppendAllLines(IEnumerable contents, Encoding encoding)
Appends lines by using the specified encoding. If the file does not exist, it creates the file.
public void AppendAllLines(IEnumerable contents, Encoding encoding)
Parameters
contents
IEnumerableThe lines to append.
encoding
EncodingThe character encoding.
AppendAllText(String contents)
Appends the specified string. If the file does not exist, it creates the file. Uses UTF-8 Encoding.
public void AppendAllText(String contents)
Parameters
contents
StringThe string to append to the file.
Remarks
http://msdn.microsoft.com/en-us/library/ms143356(v=vs.110).aspx
AppendAllText(String contents, Encoding encoding)
Appends the specified string. If the file does not exist, it creates the file.
public void AppendAllText(String contents, Encoding encoding)
Parameters
contents
StringThe string to append to the file.
encoding
EncodingThe character encoding.
Remarks
http://msdn.microsoft.com/en-us/library/ms143356(v=vs.110).aspx
AsFileInfo()
Returns a FileInfo of the current path of this file
public FileInfo AsFileInfo()
Returns
DirectoryInfo
CalculateHash(QuickIOHashImplementationType hashImplementationType)
File content hash calculation
public QuickIOHashResult CalculateHash(QuickIOHashImplementationType hashImplementationType)
CalculateHash(HashAlgorithm hashAlgorithm)
File content hash calculation
public QuickIOHashResult CalculateHash(HashAlgorithm hashAlgorithm)
Returns
QuickIOHashResult
CalculateMD5Hash()
File content hash calculation using MD5
public QuickIOHashResult CalculateMD5Hash()
Returns
QuickIOHashResult
CalculateSha1Hash()
File content hash calculation using SHA1
public QuickIOHashResult CalculateSha1Hash()
Returns
QuickIOHashResult
CalculateSha256Hash()
File content hash calculation using SHA256
public QuickIOHashResult CalculateSha256Hash()
Returns
QuickIOHashResult
CalculateSha384Hash()
File content hash calculation using SHA384
public QuickIOHashResult CalculateSha384Hash()
Returns
QuickIOHashResult
CalculateSha512Hash()
File content hash calculation using SHA512
public QuickIOHashResult CalculateSha512Hash()
Returns
QuickIOHashResult
CalculateSize(Win32FindData win32FindData)
Calculates the size of the file from the handle
private void CalculateSize(Win32FindData win32FindData)
Parameters
win32FindData
Win32FindDataGetMetadata()
Receives QuickIOFileMetadata of current file
public QuickIOFileMetadata GetMetadata()
Returns
QuickIOFileMetadata
op_Explicit(FileInfo fileInfo)
Explizit Cast
public static QuickIOFileInfo op_Explicit(FileInfo fileInfo)
Parameters
fileInfo
FileInfoFileInfo
Returns
QuickIOFileInfo
Open(FileMode mode)
Opens a FileStream
public FileStream Open(FileMode mode)
Parameters
mode
FileModeFileMode
Returns
A FileStream with read and write access and not shared.
Open(FileMode mode, FileAccess access)
Opens a FileStream
public FileStream Open(FileMode mode, FileAccess access)
Parameters
mode
FileModeFileMode
access
FileAccessFileAccess
Returns
An unshared FileStream
Open(FileMode mode, FileAccess access, FileShare share)
Opens a FileStream
public FileStream Open(FileMode mode, FileAccess access, FileShare share)
Parameters
mode
FileModeFileMode
access
FileAccessFileAccess
share
FileShareFileShare
Returns
FileStream
Remarks
http://msdn.microsoft.com/en-us/library/y973b725(v=vs.110).aspx
OpenAppend()
Opens an existing file or creates a new file for appending.
public FileStream OpenAppend()
Returns
An unshared FileStream with Write access.
OpenRead()
Opens an existing file for reading.
public FileStream OpenRead()
Returns
A read-only FileStream on the specified path.
OpenText()
Opens an existing UTF-8 encoded text file for reading.
public StreamReader OpenText()
Returns
A StreamReader.
OpenWrite()
Opens an existing file or creates a new file for writing.
public FileStream OpenWrite()
Returns
An unshared FileStream with Write access.
ReadAllBytes()
Reads the contents of the file into a byte collection.
public Byte[] ReadAllBytes()
Returns
A byte collection containing the contents.
ReadAllLines()
Reads all lines.
public IEnumerable<String> ReadAllLines()
Returns
A string collection containing all lines.
ReadAllLines(Encoding encoding)
Reads all lines with the specified encoding
public IEnumerable<String> ReadAllLines(Encoding encoding)
Parameters
encoding
EncodingThe encoding applied to the contents.
Returns
A string collection containing all lines.
ReadAllText()
Reads all text.
public String ReadAllText()
Returns
A string represents the content.
ReadAllText(Encoding encoding)
Reads all text with the specified encoding.
public String ReadAllText(Encoding encoding)
Parameters
encoding
EncodingThe encoding applied to the content.
Returns
A string represents the content.
RetriveDateTimeInformation(Win32FindData win32FindData)
Determines the time stamp of the given Win32FindData
private void RetriveDateTimeInformation(Win32FindData win32FindData)
Parameters
win32FindData
Win32FindDataWin32FindData
WriteAllBytes(Byte[] bytes)
Writes the specified byte array.
public void WriteAllBytes(Byte[] bytes)
Parameters
bytes
Byte[]The bytes to write.
WriteAllBytes(IEnumerable bytes)
Writes the specified byte array.
public void WriteAllBytes(IEnumerable bytes)
Parameters
bytes
IEnumerableThe bytes to write.
WriteAllLines(IEnumerable contents)
Writes a collection of strings. Uses UTF-8 without Emitted UTF-8 identifier.
public void WriteAllLines(IEnumerable contents)
Parameters
contents
IEnumerableThe lines write to.
WriteAllLines(IEnumerable contents, Encoding encoding)
Writes a collection of strings.
public void WriteAllLines(IEnumerable contents, Encoding encoding)
Parameters
contents
IEnumerableThe lines write to.
encoding
EncodingThe character encoding to use.
WriteAllText(String contents)
Writes the specified string.
public void WriteAllText(String contents)
Parameters
contents
StringThe string to write to.
WriteAllText(String contents, Encoding encoding)
Writes the specified string.
public void WriteAllText(String contents, Encoding encoding)
Parameters
contents
StringThe string to write to.
encoding
EncodingThe encoding to apply to the string.
Bytes
Size of the file. Cached.
public UInt64 Bytes { get; set; }
Exists
Returns true if file exists. Uncached.
public override Boolean Exists { get; }
Exceptions
UnmatchedFileSystemEntryTypeException
Path exists but it's a directory.
Length
Size of the file (returns Bytes).
public UInt64 Length { get; }