internal static class InternalQuickIO : object
Provides internal methods. All IO operations are called from here.
AddAttribute(QuickIOPathInfo pathInfo, FileAttributes attribute)
Adds a file attribute
public static Boolean AddAttribute(QuickIOPathInfo pathInfo, FileAttributes attribute)
Parameters
pathInfo
QuickIOPathInfoAffected target
attribute
FileAttributesAttribute to add
Returns
true if added. false if already exists in attributes
CopyFile(String sourceFilePath, String targetFilePath, Int32& win32Error, Boolean overwrite)
Copies a file and overwrite existing files if desired.
public static Boolean CopyFile(String sourceFilePath, String targetFilePath, Int32& win32Error, Boolean overwrite)
Parameters
sourceFilePath
StringFull source path
targetFilePath
StringFull target path
win32Error
Int32&Last error occured
overwrite
Booleantrue to overwrite existing files
Returns
True if copy succeeded, false if not. Check last Win32 Error to get further information.
Exceptions
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
CreateDirectory(QuickIOPathInfo pathInfo, Boolean recursive)
Creates a new directory. If recursive is false, the parent directory must exists.
public static void CreateDirectory(QuickIOPathInfo pathInfo, Boolean recursive)
Parameters
pathInfo
QuickIOPathInfoQuickIOPathInfo
recursive
BooleanIf recursive is false, the parent directory must exist.
Exceptions
PathAlreadyExistsException
The specified path already exists.
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
CreateFile(QuickIOPathInfo pathInfo, FileAccess fileAccess, FileShare fileShare, FileMode fileMode, FileAttributes fileAttributes)
Creates a new file.
public static void CreateFile(QuickIOPathInfo pathInfo, FileAccess fileAccess, FileShare fileShare, FileMode fileMode, FileAttributes fileAttributes)
Exceptions
PathAlreadyExistsException
The specified path already exists.
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
CreateSafeFileHandle(String path)
Returns the SafeFileHandle and fills Win32FindData from the passes path.
private static SafeFileHandle CreateSafeFileHandle(String path)
Parameters
path
StringPath to the file system entry
Returns
SafeFileHandle
Exceptions
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
CreateSafeFileHandle(QuickIOPathInfo info)
Returns the SafeFileHandle and fills Win32FindData from the passes path.
internal static SafeFileHandle CreateSafeFileHandle(QuickIOPathInfo info)
Parameters
info
QuickIOPathInfoPath to the file system entry
Returns
SafeFileHandle
Exceptions
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
DeleteDirectory(QuickIOPathInfo pathInfo, Boolean recursive)
Deletes all files in the given directory. On request all contents, too.
public static void DeleteDirectory(QuickIOPathInfo pathInfo, Boolean recursive)
Parameters
pathInfo
QuickIOPathInfoPathInfo of directory to clear
recursive
BooleanIf recursive is true then all subfolders are also deleted.
Exceptions
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
DirectoryNotEmptyException
The directory is not empty.
Remarks
Function loads every file and attribute. Alls read-only flags will be removed before removing.
DeleteFile(QuickIOPathInfo pathInfo)
Removes a file.
public static void DeleteFile(QuickIOPathInfo pathInfo)
Parameters
pathInfo
QuickIOPathInfoPathInfo of the file to remove
Exceptions
FileNotFoundException
This error is fired if the specified file to remove does not exist.
DeleteFile(String path)
Removes a file.
public static void DeleteFile(String path)
Parameters
path
StringPath to the file to remove
Exceptions
FileNotFoundException
This error is fired if the specified file to remove does not exist.
DeleteFile(QuickIOFileInfo fileInfo)
Removes a file.
public static void DeleteFile(QuickIOFileInfo fileInfo)
Parameters
fileInfo
QuickIOFileInfoFileInfo of the file to remove
Exceptions
PathNotFoundException
This error will be fired if the specified path or a part of them does not exist.
FileNotFoundException
This error will be fired when attempting a file to delete, which does not exist.
DeleteFiles(String directoryPath, Boolean recursive)
Deletes all files in the given directory.
public static void DeleteFiles(String directoryPath, Boolean recursive)
Parameters
directoryPath
StringPath of directory to clear
recursive
BooleanIf true all files in all all subfolders included
Exceptions
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
FileNotFoundException
This error will be fired when attempting a file to delete, which does not exist.
EnumerateDirectories(QuickIOPathInfo pathInfo, SearchOption searchOption, QuickIOEnumerateOptions enumerateOptions)
Determined all subfolders of a directory
internal static IEnumerable<QuickIODirectoryInfo> EnumerateDirectories(QuickIOPathInfo pathInfo, SearchOption searchOption, QuickIOEnumerateOptions enumerateOptions)
Parameters
pathInfo
QuickIOPathInfoPath of the directory
searchOption
SearchOptionSearchOption
enumerateOptions
QuickIOEnumerateOptionsThe enumeration options for exception handling
Returns
QuickIODirectoryInfo collection of subfolders
Exceptions
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
EnumerateDirectoryMetadata(QuickIOPathInfo pathInfo, QuickIOEnumerateOptions enumerateOptions)
Determined metadata of directory
internal static QuickIODirectoryMetadata EnumerateDirectoryMetadata(QuickIOPathInfo pathInfo, QuickIOEnumerateOptions enumerateOptions)
Parameters
pathInfo
QuickIOPathInfoPath of the directory
enumerateOptions
QuickIOEnumerateOptionsThe enumeration options for exception handling
Returns
QuickIODirectoryMetadata started with the given directory
Exceptions
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
EnumerateDirectoryMetadata(String uncDirectoryPath, Win32FindData findData, QuickIOEnumerateOptions enumerateOptions)
Determined metadata of directory
internal static QuickIODirectoryMetadata EnumerateDirectoryMetadata(String uncDirectoryPath, Win32FindData findData, QuickIOEnumerateOptions enumerateOptions)
Parameters
uncDirectoryPath
StringPath of the directory
findData
Win32FindDataWin32FindData
enumerateOptions
QuickIOEnumerateOptionsThe enumeration options for exception handling
Returns
QuickIODirectoryMetadata started with the given directory
Exceptions
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
EnumerateDirectoryPaths(String path, SearchOption searchOption, QuickIOEnumerateOptions enumerateOptions, QuickIOPathType pathFormatReturn)
Determined all sub directory paths of a directory
internal static IEnumerable<String> EnumerateDirectoryPaths(String path, SearchOption searchOption, QuickIOEnumerateOptions enumerateOptions, QuickIOPathType pathFormatReturn)
Parameters
path
StringPath of the directory
searchOption
SearchOptionSearchOption
pathFormatReturn
QuickIOPathTypeSpecifies the type of path to return.
enumerateOptions
QuickIOEnumerateOptionsThe enumeration options for exception handling
Returns
Collection of directory paths
Exceptions
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
EnumerateFilePaths(String path, SearchOption searchOption, QuickIOEnumerateOptions enumerateOptions, QuickIOPathType pathFormatReturn)
Determined all files paths of a directory
internal static IEnumerable<String> EnumerateFilePaths(String path, SearchOption searchOption, QuickIOEnumerateOptions enumerateOptions, QuickIOPathType pathFormatReturn)
Parameters
path
StringPath of the directory
searchOption
SearchOptionSearchOption
pathFormatReturn
QuickIOPathTypeSpecifies the type of path to return.
enumerateOptions
QuickIOEnumerateOptionsThe enumeration options for exception handling
Returns
Collection of file paths
Exceptions
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
EnumerateFiles(String uncDirectoryPath, SearchOption searchOption, QuickIOEnumerateOptions enumerateOptions)
Determined all files of a directory
internal static IEnumerable<QuickIOFileInfo> EnumerateFiles(String uncDirectoryPath, SearchOption searchOption, QuickIOEnumerateOptions enumerateOptions)
Parameters
uncDirectoryPath
StringPath of the directory
searchOption
SearchOptionSearchOption
enumerateOptions
QuickIOEnumerateOptionsThe enumeration options for exception handling
Returns
Collection of files
Exceptions
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
EnumerateFiles(QuickIOPathInfo pathInfo, SearchOption searchOption, QuickIOEnumerateOptions enumerateOptions)
Determined all files of a directory
internal static IEnumerable<QuickIOFileInfo> EnumerateFiles(QuickIOPathInfo pathInfo, SearchOption searchOption, QuickIOEnumerateOptions enumerateOptions)
Parameters
pathInfo
QuickIOPathInfoPath of the directory
searchOption
SearchOptionSearchOption
Returns
Collection of files
Exceptions
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
EnumerateFileSystemEntries(String uncDirectoryPath, SearchOption searchOption, QuickIOEnumerateOptions enumerateOptions)
Determined all sub system entries of a directory
private static IEnumerable<KeyValuePair<String, QuickIOFileSystemEntryType>> EnumerateFileSystemEntries(String uncDirectoryPath, SearchOption searchOption, QuickIOEnumerateOptions enumerateOptions)
Parameters
uncDirectoryPath
StringPath of the directory
searchOption
SearchOptionSearchOption
enumerateOptions
QuickIOEnumerateOptionsThe enumeration options for exception handling
Returns
Collection of QuickIODirectoryInfo
Exceptions
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
EnumerateFileSystemEntries(QuickIOPathInfo pathInfo, SearchOption searchOption, QuickIOEnumerateOptions enumerateOptions)
Determined all sub system entries of a directory
internal static IEnumerable<KeyValuePair<String, QuickIOFileSystemEntryType>> EnumerateFileSystemEntries(QuickIOPathInfo pathInfo, SearchOption searchOption, QuickIOEnumerateOptions enumerateOptions)
Parameters
pathInfo
QuickIOPathInfoPath of the directory
searchOption
SearchOptionSearchOption
enumerateOptions
QuickIOEnumerateOptionsThe enumeration options for exception handling
Returns
Collection of QuickIODirectoryInfo
Exceptions
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
EnumerateFileSystemEntryPaths(String uncDirectoryPath, SearchOption searchOption, QuickIOEnumerateOptions enumerateOptions, QuickIOPathType pathFormatReturn)
Determined all sub file system entries of a directory
private static IEnumerable<KeyValuePair<String, QuickIOFileSystemEntryType>> EnumerateFileSystemEntryPaths(String uncDirectoryPath, SearchOption searchOption, QuickIOEnumerateOptions enumerateOptions, QuickIOPathType pathFormatReturn)
Parameters
uncDirectoryPath
StringPath of the directory
searchOption
SearchOptionSearchOption
pathFormatReturn
QuickIOPathTypeSpecifies the type of path to return.
enumerateOptions
QuickIOEnumerateOptionsThe enumeration options for exception handling
Returns
Collection of QuickIODirectoryInfo
Exceptions
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
EnumerateFileSystemEntryPaths(QuickIOPathInfo pathInfo, SearchOption searchOption, QuickIOEnumerateOptions enumerateOptions, QuickIOPathType pathFormatReturn)
Determined all sub file system entries of a directory
internal static IEnumerable<KeyValuePair<String, QuickIOFileSystemEntryType>> EnumerateFileSystemEntryPaths(QuickIOPathInfo pathInfo, SearchOption searchOption, QuickIOEnumerateOptions enumerateOptions, QuickIOPathType pathFormatReturn)
Parameters
pathInfo
QuickIOPathInfoPath of the directory
searchOption
SearchOptionSearchOption
pathFormatReturn
QuickIOPathTypeSpecifies the type of path to return.
enumerateOptions
QuickIOEnumerateOptionsThe enumeration options for exception handling
Returns
Collection of QuickIODirectoryInfo
Exceptions
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
EnumerationHandleInvalidFileHandle(String path, QuickIOEnumerateOptions enumerateOptions, Int32 win32Error)
Handles the options to the fired exception
private static Boolean EnumerationHandleInvalidFileHandle(String path, QuickIOEnumerateOptions enumerateOptions, Int32 win32Error)
Exists(QuickIOPathInfo pathInfo)
Reurns true if passed path exists
public static Boolean Exists(QuickIOPathInfo pathInfo)
Parameters
pathInfo
QuickIOPathInfoPath to check
FindFirstFileManaged(String uncPath, Win32FindData win32FindData, Int32& win32Error)
Returns the handle by given path and finddata
private static Win32FileHandle FindFirstFileManaged(String uncPath, Win32FindData win32FindData, Int32& win32Error)
Parameters
uncPath
StringSpecified path
win32FindData
Win32FindDataFindData to fill
win32Error
Int32&Win32Error Code. 0 on success
Returns
Win32FileHandle of specified path
FindFirstSafeFileHandle(String path, Win32FindData win32FindData, Int32& win32Error)
Returns the SafeFileHandle and fills Win32FindData from the passes path.
private static Win32FileHandle FindFirstSafeFileHandle(String path, Win32FindData win32FindData, Int32& win32Error)
Parameters
path
StringPath to the file system entry
win32FindData
Win32FindDatawin32Error
Int32&Last error code. 0 if no error occurs
Returns
SafeFileHandle
Exceptions
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
private static IEnumerable<String> FindPaths(String uncDirectoryPath, SearchOption searchOption, Nullable filterType, QuickIOEnumerateOptions enumerateOptions, QuickIOPathType pathFormatReturn)
Parameters
uncDirectoryPath
StringStart directory path
searchOption
SearchOptionSearchOption
enumerateOptions
QuickIOEnumerateOptionsThe enumeration options for exception handling
pathFormatReturn
QuickIOPathTypeSpecifies the type of path to return.
filterType
NullableQuickIOFileSystemEntryType
Returns
Collection of path
Exceptions
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
private static String FormatPathByType(QuickIOPathType pathFormatReturn, String uncPath)
Parameters
pathFormatReturn
QuickIOPathTypeTarget format type
uncPath
StringPath to format
Returns
Formatted path
GetAttributes(QuickIOPathInfo pathInfo)
Gets the FileAttributes of the file on the entry.
internal static FileAttributes GetAttributes(QuickIOPathInfo pathInfo)
Parameters
pathInfo
QuickIOPathInfoThe path to the entry.
Returns
The FileAttributes of the file on the entry.
Exceptions
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
GetDirectoryStatistics(String path, QuickIOEnumerateOptions enumerateOptions)
Determines the statistics of the given directory. This includes the number of files, folders and the total size in bytes. ///
public static QuickIOFolderStatisticResult GetDirectoryStatistics(String path, QuickIOEnumerateOptions enumerateOptions)
Parameters
path
StringPath to the directory to generate the statistics.
Returns
Provides the statistics of the directory
Exceptions
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
GetDirectoryStatistics(QuickIOPathInfo pathInfo, QuickIOEnumerateOptions enumerateOptions)
Determines the statistics of the given directory. This includes the number of files, folders and the total size in bytes.
public static QuickIOFolderStatisticResult GetDirectoryStatistics(QuickIOPathInfo pathInfo, QuickIOEnumerateOptions enumerateOptions)
Parameters
pathInfo
QuickIOPathInfoPathInfo of the directory to generate the statistics.
Returns
Provides the statistics of the directory
Exceptions
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
GetFindDataFromPath(String fullUncPath, Nullable estimatedFileSystemEntryType)
Gets the Win32FindData from the passed path.
public static Win32FindData GetFindDataFromPath(String fullUncPath, Nullable estimatedFileSystemEntryType)
Parameters
fullUncPath
StringPath to the file system entry
estimatedFileSystemEntryType
NullableEstimated Type (File or Directory)
Exceptions
UnmatchedFileSystemEntryTypeException
Searched for file but found folder or vise versa.
PathNotFoundException
No entry found for passed path
GetFindDataFromPath(QuickIOPathInfo pathInfo, Nullable estimatedFileSystemEntryType)
Gets the Win32FindData from the passed QuickIOPathInfo
public static Win32FindData GetFindDataFromPath(QuickIOPathInfo pathInfo, Nullable estimatedFileSystemEntryType)
Parameters
pathInfo
QuickIOPathInfoPath to the file system entry
estimatedFileSystemEntryType
NullableEstimated Type (File or Directory)
Exceptions
UnmatchedFileSystemEntryTypeException
Searched for file but found folder or vise versa.
PathNotFoundException
No entry found for passed path
GetFindDataFromPath(QuickIOPathInfo pathInfo)
Returns the Win32FindData from specified pathInfo
public static Win32FindData GetFindDataFromPath(QuickIOPathInfo pathInfo)
Parameters
pathInfo
QuickIOPathInfoPath to the file system entry
fullUncPath
Path to the file system entry
Returns
Win32FindData
Exceptions
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
LoadDirectoryFromPathInfo(QuickIOPathInfo pathInfo)
Loads a directory from specified path
public static QuickIODirectoryInfo LoadDirectoryFromPathInfo(QuickIOPathInfo pathInfo)
Parameters
pathInfo
QuickIOPathInfoFull path
Returns
QuickIODirectoryInfo
Exceptions
UnmatchedFileSystemEntryTypeException
Path exists but it's not a directory; it's a file.
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
LoadFileFromPathInfo(QuickIOPathInfo pathInfo)
Loads a file from specified path
public static QuickIOFileInfo LoadFileFromPathInfo(QuickIOPathInfo pathInfo)
Parameters
pathInfo
QuickIOPathInfoFull path
Returns
QuickIOFileInfo
Exceptions
UnmatchedFileSystemEntryTypeException
Path exists but it's not a file; it's a directory.
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
MoveFile(String sourceFileName, String destFileName)
Moves a file
public static void MoveFile(String sourceFileName, String destFileName)
Parameters
sourceFileName
StringFull source path
destFileName
StringFull target path
OpenReadWriteFileSystemEntryHandle(String path)
Returns the SafeFileHandle and fills Win32FindData from the passes path.
internal static SafeFileHandle OpenReadWriteFileSystemEntryHandle(String path)
Parameters
path
StringPath to the file system entry
Returns
SafeFileHandle
Exceptions
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
RemoveAttribute(QuickIOPathInfo pathInfo, FileAttributes attribute)
Remove a file attribute
public static Boolean RemoveAttribute(QuickIOPathInfo pathInfo, FileAttributes attribute)
Parameters
pathInfo
QuickIOPathInfoAffected target
attribute
FileAttributesAttribute to remove
Returns
true if removed. false if not exists in attributes
SetAllFileTimes(QuickIOPathInfo pathInfo, DateTime creationTimeUtc, DateTime lastAccessTimeUtc, DateTime lastWriteTimeUtc)
Sets the dates and times of given directory or file.
public static void SetAllFileTimes(QuickIOPathInfo pathInfo, DateTime creationTimeUtc, DateTime lastAccessTimeUtc, DateTime lastWriteTimeUtc)
Parameters
pathInfo
QuickIOPathInfoAffected file or directory
creationTimeUtc
DateTimeThe time that is to be used (UTC)
lastAccessTimeUtc
DateTimeThe time that is to be used (UTC)
lastWriteTimeUtc
DateTimeThe time that is to be used (UTC)
SetAttributes(QuickIOPathInfo pathInfo, FileAttributes attributes)
Sets the specified FileAttributes of the entry on the specified path.
public static void SetAttributes(QuickIOPathInfo pathInfo, FileAttributes attributes)
Parameters
pathInfo
QuickIOPathInfoThe path to the entry.
attributes
FileAttributesA bitwise combination of the enumeration values.
Exceptions
Win32Exception
Unmatched Exception
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
SetCreationTimeUtc(QuickIOPathInfo pathInfo, DateTime utcTime)
Sets the time at which the file or directory was created (UTC)
public static void SetCreationTimeUtc(QuickIOPathInfo pathInfo, DateTime utcTime)
Parameters
pathInfo
QuickIOPathInfoAffected file or directory
utcTime
DateTimeThe time that is to be used (UTC)
SetLastAccessTimeUtc(QuickIOPathInfo pathInfo, DateTime utcTime)
Sets the time at which the file or directory was last accessed to (UTC)
public static void SetLastAccessTimeUtc(QuickIOPathInfo pathInfo, DateTime utcTime)
Parameters
pathInfo
QuickIOPathInfoAffected file or directory
utcTime
DateTimeThe time that is to be used (UTC)
SetLastWriteTimeUtc(QuickIOPathInfo pathInfo, DateTime utcTime)
Sets the time at which the file or directory was last written to (UTC)
public static void SetLastWriteTimeUtc(QuickIOPathInfo pathInfo, DateTime utcTime)
Parameters
pathInfo
QuickIOPathInfoAffected file or directory
utcTime
DateTimeThe time that is to be used (UTC)
TryGetFindDataFromPath(QuickIOPathInfo pathInfo, Win32FindData& pathFindData)
Gets the Win32FindData from the passed path.
public static Boolean TryGetFindDataFromPath(QuickIOPathInfo pathInfo, Win32FindData& pathFindData)
Parameters
pathInfo
QuickIOPathInfopathFindData
Win32FindData&. Will be null if path does not exist.
Returns
true if path is valid and Win32FindData is set
Exceptions
PathNotFoundException
This error is fired if the specified path or a part of them does not exist.
Remarks
if invalid handle found.