public class QuickIOFileInfo : QuickIOFileSystemEntryBase
Provides properties and instance methods for files
DefaultChunkSize
Default ChunkSize
private const Int32 DefaultChunkSize
Constant Value
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(FileInfo fileInfo)
Create new instance of QuickIOFileInfo
public void QuickIOFileInfo(FileInfo fileInfo)
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.
AppendAllLinesAsync(IEnumerable contents)
Appends lines to a file. Uses UTF-8 Encoding.
public Task AppendAllLinesAsync(IEnumerable contents)
Parameters
contents
IEnumerableThe lines to append.
AppendAllLinesAsync(IEnumerable contents, Encoding encoding)
Appends lines by using the specified encoding. If the file does not exist, it creates the file.
public Task AppendAllLinesAsync(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
AppendAllTextAsync(String contents)
Appends the specified string. If the file does not exist, it creates the file. Uses UTF-8 Encoding.
public Task AppendAllTextAsync(String contents)
Parameters
contents
StringThe string to append to the file.
Remarks
http://msdn.microsoft.com/en-us/library/ms143356(v=vs.110).aspx
AppendAllTextAsync(String contents, Encoding encoding)
Appends the specified string. If the file does not exist, it creates the file.
public Task AppendAllTextAsync(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
AsFileInfoAsync()
Returns a FileInfo of the current path of this file
public Task<FileInfo> AsFileInfoAsync()
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
CalculateHashAsync(QuickIOHashImplementationType hashImplementationType)
File content hash calculation
public Task<QuickIOHashResult> CalculateHashAsync(QuickIOHashImplementationType hashImplementationType)
CalculateHashAsync(HashAlgorithm hashAlgorithm)
File content hash calculation
public Task<QuickIOHashResult> CalculateHashAsync(HashAlgorithm hashAlgorithm)
Returns
QuickIOHashResult
CalculateMD5Hash()
File content hash calculation using MD5
public QuickIOHashResult CalculateMD5Hash()
Returns
QuickIOHashResult
CalculateMD5HashAsync()
File content hash calculation using MD5
public Task<QuickIOHashResult> CalculateMD5HashAsync()
Returns
QuickIOHashResult
CalculateSha1Hash()
File content hash calculation using SHA1
public QuickIOHashResult CalculateSha1Hash()
Returns
QuickIOHashResult
CalculateSha1HashAsync()
File content hash calculation using SHA1
public Task<QuickIOHashResult> CalculateSha1HashAsync()
Returns
QuickIOHashResult
CalculateSha256Hash()
File content hash calculation using SHA256
public QuickIOHashResult CalculateSha256Hash()
Returns
QuickIOHashResult
CalculateSha256HashAsync()
File content hash calculation using SHA256
public Task<QuickIOHashResult> CalculateSha256HashAsync()
Returns
QuickIOHashResult
CalculateSha384Hash()
File content hash calculation using SHA384
public QuickIOHashResult CalculateSha384Hash()
Returns
QuickIOHashResult
CalculateSha384HashAsync()
File content hash calculation using SHA384
public Task<QuickIOHashResult> CalculateSha384HashAsync()
Returns
QuickIOHashResult
CalculateSha512Hash()
File content hash calculation using SHA512
public QuickIOHashResult CalculateSha512Hash()
Returns
QuickIOHashResult
CalculateSha512HashAsync()
File content hash calculation using SHA512
public Task<QuickIOHashResult> CalculateSha512HashAsync()
Returns
QuickIOHashResult
CalculateSize(Win32FindData win32FindData)
Calculates the size of the file from the handle
private void CalculateSize(Win32FindData win32FindData)
Parameters
win32FindData
Win32FindDataCompareTimestamps(QuickIOFileInfo file)
Checks all timestamps.
public IEnumerable<QuickIOFileCompareCriteria> CompareTimestamps(QuickIOFileInfo file)
Parameters
file
QuickIOFileInfoFile to compare with
Returns
If collection is empty, all timestamps are equal. Otherwise unequal timestamp is returned.
CompressData()
Returns all bytes of GetCompressStream
public Byte[] CompressData()
CompressDataAsync()
Returns all bytes of GetCompressStream
public Task<Byte[]> CompressDataAsync()
DecompressData()
Returns all bytes of GetDecompressStream
public Byte[] DecompressData()
DecompressDataAsync()
Returns all bytes of GetDecompressStream
public Task<Byte[]> DecompressDataAsync()
GetCompressStream(Int32 readBuffer)
Compress all data of file and returns filled MemoryStream
public MemoryStream GetCompressStream(Int32 readBuffer)
GetCompressStreamAsync(Int32 readBuffer)
Compress all data of file and returns filled MemoryStream
public Task<MemoryStream> GetCompressStreamAsync(Int32 readBuffer)
GetDecompressStream(Int32 readBuffer)
Decompress all data of file and returns filled MemoryStream
public MemoryStream GetDecompressStream(Int32 readBuffer)
GetDecompressStreamAsync(Int32 readBuffer)
Decompress all data of file and returns filled MemoryStream
public Task<MemoryStream> GetDecompressStreamAsync(Int32 readBuffer)
GetFileChunks(Int32 chunkSize)
Returns the file chunks by given chunksize
public IEnumerable<QuickIOFileChunk> GetFileChunks(Int32 chunkSize)
Parameters
chunkSize
Int32Chunk size (Bytes)
Returns
Collection of chunks. On enumerator, the file gets read.
GetFileChunksAsync(Int32 chunkSize)
Returns the file chunks by given chunksize
public Task<IEnumerable<QuickIOFileInfo>> GetFileChunksAsync(Int32 chunkSize)
Parameters
chunkSize
Int32Chunk size (Bytes)
Returns
Collection of chunks. On enumerator, the file gets read.
GetFileChunksEnumerator(Int32 chunkSize)
Returns the of GetFileChunks
public IEnumerator<QuickIOFileChunk> GetFileChunksEnumerator(Int32 chunkSize)
Parameters
chunkSize
Int32Chunk size (Bytes)
GetFileChunksEqual(QuickIOFileInfo file, Int32 chunkSize)
Returns the chunks of current file that are identical with the other file
public IEnumerable<QuickIOFileChunk> GetFileChunksEqual(QuickIOFileInfo file, Int32 chunkSize)
Parameters
file
QuickIOFileInfoFile to compare
chunkSize
Int32Chunk size (Bytes)
Returns
Returns the chunks of current file that are identical with the other file
GetFileChunksEqualAsync(QuickIOFileInfo file, Int32 chunkSize)
Returns the chunks of current file that are identical with the other file
public Task<IEnumerable<QuickIOFileInfo>> GetFileChunksEqualAsync(QuickIOFileInfo file, Int32 chunkSize)
Parameters
file
QuickIOFileInfoFile to compare
chunkSize
Int32Chunk size (Bytes)
Returns
Returns the chunks of current file that are identical with the other file
GetFileChunksUnequal(QuickIOFileInfo file, Int32 chunkSize)
Returns the chunks of current file that are NOT identical with the other file
public IEnumerable<QuickIOFileChunk> GetFileChunksUnequal(QuickIOFileInfo file, Int32 chunkSize)
Parameters
file
QuickIOFileInfoFile to compare
chunkSize
Int32Chunk size (Bytes)
Returns
Returns the chunks of current file that are NOT identical with the other file
GetFileChunksUnequalAsync(QuickIOFileInfo file, Int32 chunkSize)
Returns the chunks of current file that are NOT identical with the other file
public Task<IEnumerable<QuickIOFileInfo>> GetFileChunksUnequalAsync(QuickIOFileInfo file, Int32 chunkSize)
Parameters
file
QuickIOFileInfoFile to compare
chunkSize
Int32Chunk size (Bytes)
Returns
Returns the chunks of current file that are NOT identical with the other file
GetMetadata()
Receives QuickIOFileMetadata of current file
public QuickIOFileMetadata GetMetadata()
Returns
QuickIOFileMetadata
GetMetadataAsync()
Receives QuickIOFileMetadata of current file
public Task<QuickIOFileMetadata> GetMetadataAsync()
Returns
QuickIOFileMetadata
InternalEnumerateFileChunks(Int32 chunkSize)
Reads the file and returns containign chunks
private IEnumerable<QuickIOFileChunk> InternalEnumerateFileChunks(Int32 chunkSize)
Parameters
chunkSize
Int32Chunk size (Bytes)
Returns
Collection of chunks
InternalGetGZipStream(Int32 readBuffer, CompressionMode mode)
Internal Usage only
private MemoryStream InternalGetGZipStream(Int32 readBuffer, CompressionMode mode)
InternalIsEqualTimestampCreated(QuickIOFileInfo file)
Same as IsEqualTimestampCreated but does not check the param for null
private Boolean InternalIsEqualTimestampCreated(QuickIOFileInfo file)
InternalIsEqualTimestampLastAccessed(QuickIOFileInfo file)
Same as IsEqualTimestampLastAccessed but does not check the param for null
private Boolean InternalIsEqualTimestampLastAccessed(QuickIOFileInfo file)
InternalIsEqualTimestampsLastWritten(QuickIOFileInfo file)
Same as IsEqualTimestampsLastWritten but does not check the param for null
private Boolean InternalIsEqualTimestampsLastWritten(QuickIOFileInfo file)
IsEqualByteLength(QuickIOFileInfo file)
Checks byte length (NOT CONTENTS!)
public Boolean IsEqualByteLength(QuickIOFileInfo file)
Parameters
file
QuickIOFileInfoFile to compare with
Returns
Returns true if both Bytes properties are equal
IsEqualContents(QuickIOFileInfo file, Int32 chunkSize)
Checks if both file contents are equal. Opens both files for read and breaks on first unequal chunk.
public Boolean IsEqualContents(QuickIOFileInfo file, Int32 chunkSize)
Parameters
file
QuickIOFileInfoFile to compare
chunkSize
Int32Chunk size (Bytes)
Returns
true if contents are equal
IsEqualContentsAsync(QuickIOFileInfo file, Int32 chunkSize)
Checks if both file contents are equal. Opens both files for read and breaks on first unequal chunk.
public Task<Boolean> IsEqualContentsAsync(QuickIOFileInfo file, Int32 chunkSize)
Parameters
file
QuickIOFileInfoFile to compare
chunkSize
Int32Chunk size (Bytes)
Returns
true if contents are equal
IsEqualTimestampCreated(QuickIOFileInfo file)
Returns the if timestamp 'created' is equal
public Boolean IsEqualTimestampCreated(QuickIOFileInfo file)
Parameters
file
QuickIOFileInfoFile to compare with
Returns
Returns the if timestamp 'created' is equal
IsEqualTimestampLastAccessed(QuickIOFileInfo file)
Returns the if timestamp 'last accessed' is equal
public Boolean IsEqualTimestampLastAccessed(QuickIOFileInfo file)
Parameters
file
QuickIOFileInfoFile to compare with
Returns
Returns the if timestamp 'last accessed' is equal
IsEqualTimestamps(QuickIOFileInfo file)
Returns the if all timestamps are equal
public Boolean IsEqualTimestamps(QuickIOFileInfo file)
Parameters
file
QuickIOFileInfoFile to compare with
Returns
Returns the if all timestamps are equal
IsEqualTimestampsLastWritten(QuickIOFileInfo file)
Returns the if timestamp 'last written to' is equal
public Boolean IsEqualTimestampsLastWritten(QuickIOFileInfo file)
Parameters
file
QuickIOFileInfoFile to compare with
Returns
Returns the if timestamp 'last written to' is equal
op_Explicit(FileInfo fileInfo)
Explizit Cast
public static QuickIOFileInfo op_Explicit(FileInfo fileInfo)
Parameters
fileInfo
FileInfoQuickIOFileInfo
Returns
QuickIODirectoryInfo
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.
OpenAppendAsync()
Opens an existing file or creates a new file for appending.
public Task<FileStream> OpenAppendAsync()
Returns
An unshared FileStream with Write access.
OpenAsync(FileMode mode)
Opens a FileStream
public Task<FileStream> OpenAsync(FileMode mode)
Parameters
mode
FileModeFileMode
Returns
A FileStream with read and write access and not shared.
OpenAsync(FileMode mode, FileAccess access)
Opens a FileStream
public Task<FileStream> OpenAsync(FileMode mode, FileAccess access)
Parameters
mode
FileModeFileMode
access
FileAccessFileAccess
Returns
An unshared FileStream
OpenAsync(FileMode mode, FileAccess access, FileShare share)
Opens a FileStream
public Task<FileStream> OpenAsync(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
OpenRead()
Opens an existing file for reading.
public FileStream OpenRead()
Returns
A read-only FileStream on the specified path.
OpenReadAsync()
Opens an existing file for reading.
public Task<FileStream> OpenReadAsync()
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.
OpenTextAsync()
Opens an existing UTF-8 encoded text file for reading.
public Task<StreamReader> OpenTextAsync()
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.
OpenWriteAsync()
Opens an existing file or creates a new file for writing.
public Task<FileStream> OpenWriteAsync()
Returns
An unshared FileStream with Write access.
ReadAllBytes(Int32 readBuffer)
Reads the contents of the file into a byte collection.
public Byte[] ReadAllBytes(Int32 readBuffer)
Returns
A byte collection containing the contents.
ReadAllBytesAsync(Int32 readBuffer)
Reads the contents of the file into a byte collection.
public Task<Byte[]> ReadAllBytesAsync(Int32 readBuffer)
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.
ReadAllLinesAsync()
Reads all lines.
public Task<IEnumerable<QuickIOFileInfo>> ReadAllLinesAsync()
Returns
A string collection containing all lines.
ReadAllLinesAsync(Encoding encoding)
Reads all lines with the specified encoding
public Task<IEnumerable<QuickIOFileInfo>> ReadAllLinesAsync(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.
ReadAllTextAsync()
Reads all text.
public Task<String> ReadAllTextAsync()
Returns
A string represents the content.
ReadAllTextAsync(Encoding encoding)
Reads all text with the specified encoding.
public Task<String> ReadAllTextAsync(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.
WriteAllBytesAsync(Byte[] bytes)
Writes the specified byte array.
public Task WriteAllBytesAsync(Byte[] bytes)
Parameters
bytes
Byte[]The bytes to write.
WriteAllBytesAsync(IEnumerable bytes)
Writes the specified byte array.
public Task WriteAllBytesAsync(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.
WriteAllLinesAsync(IEnumerable contents)
Writes a collection of strings. Uses UTF-8 without Emitted UTF-8 identifier.
public Task WriteAllLinesAsync(IEnumerable contents)
Parameters
contents
IEnumerableThe lines write to.
WriteAllLinesAsync(IEnumerable contents, Encoding encoding)
Writes a collection of strings.
public Task WriteAllLinesAsync(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.
WriteAllTextAsync(String contents)
Writes the specified string.
public Task WriteAllTextAsync(String contents)
Parameters
contents
StringThe string to write to.
WriteAllTextAsync(String contents, Encoding encoding)
Writes the specified string.
public Task WriteAllTextAsync(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.
ExistsAsync
Returns true if file exists. Uncached.
public override Task<Boolean> ExistsAsync { get; }
Exceptions
UnmatchedFileSystemEntryTypeException
Path exists but it's a directory.
Length
Size of the file (returns Bytes).
public UInt64 Length { get; }