IOUtilities Class |
Namespace: ShellBoost.Core.Utilities
public static class IOUtilities
The IOUtilities type exposes the following members.
| Name | Description | |
|---|---|---|
| CopyTo |
Reads the bytes from the current stream and writes them to another stream.
| |
| CopyToAsync(Stream, Stream, Int64, Int32) |
Reads the bytes from the current stream and writes them to another stream.
| |
| CopyToAsync(Stream, Stream, CancellationToken, Int64, Int32) |
Reads the bytes from the current stream and writes them to another stream.
| |
| DenormalizePath |
Removes the long file name prefix "\\?\" from a rooted path.
If the path is not rooted, it will be returned as is.
| |
| DirectoryCopy(DirectoryInfo, DirectoryInfo, Boolean) |
Copies a directory.
| |
| DirectoryCopy(String, String, Boolean) |
Copies a directory.
| |
| DirectoryCreate |
Creates the specified directory.
| |
| DirectoryDelete |
Deletes the specified directory and, if indicated, any subdirectories and files in the directory.
| |
| DirectoryExists |
Test if a directory exists. Supports invalid file paths, never throws.
| |
| DirectoryMove |
Moves a directory.
| |
| ExtractAssemblyResource |
Extracts a resource from an assembly to a file.
| |
| FileCreateDirectory |
Create the directory needed to contain a specified file path.
| |
| FileDelete |
Deletes a file.
| |
| FileExists |
Test if a file exists. Supports invalid file paths, never throws.
| |
| FileMove |
Moves a file.
| |
| FileOverwrite |
Overwrites a file.
| |
| FileSetEnd |
Sets the size for the specified file.
| |
| FileUnprotect |
Unprotects a file.
| |
| FindContentType(Byte) |
Determines the MIME type from the data provided. Based on Windows FindMimeFromData function.
| |
| FindContentType(String) |
Determines the MIME type from a file path. Based on Windows FindMimeFromData function.
| |
| GetFileExtensionFromContentType |
Gets a file extension from a content type.
| |
| IsPathRooted |
Gets a value indicating whether the specified path string contains a root.
| |
| IsSharingViolation |
Determines whether the specified exception represents a sharing violation error.
| |
| NormalizePath |
Normalizes a path with the long file name prefix "\\?\".
If the path is not rooted, it will be returned as is.
| |
| PathCombineNoCheck(String) |
Combines an array of strings into a path. Parts may not be valid file names.
| |
| PathCombineNoCheck(Char, String) |
Combines an array of strings into a path. Parts may not be valid file names.
| |
| PathDelete |
Deletes the specified directory or file and, if indicated, any subdirectories and files in the directory.
| |
| PathExists |
Determines if a path points to an existing directory or file.
| |
| PathGetAttributes |
Gets the attributes of a file or directory.
If there's no file at the given path, returns null.
| |
| PathGetCreationTime |
Gets the creation time of a file or directory.
If there's nothing at the given path, returns null.
| |
| PathGetExtension |
Get path extension.
| |
| PathGetLastAccessTime |
Gets the last access time of a file or directory.
If there's nothing at the given path, returns null.
| |
| PathGetLastWriteTime |
Gets the last write time of a file or directory.
If there's nothing at the given path, returns null.
| |
| PathGetName |
Get the name part of the path.
| |
| PathGetNameWithoutExtension |
Get the name part of the path without the extension.
| |
| PathGetRealPath |
Get the real case-sensitive path.
| |
| PathGetSize |
Gets the size of a file or directory. Always returns null for a directory.
If there's no file at the given path, returns null.
| |
| PathHasInvalidChars |
Determines if the specified path has invalid chars.
| |
| PathIsChild(String, String, Boolean) |
Tests if a path is a child of another path.
| |
| PathIsChild(String, String, Boolean, String) |
Tests if a path is a child of another path.
| |
| PathIsChildOrEqual |
Tests if a path is a child of or equal to another path.
| |
| PathIsDirectory |
Determines if a path points to an existing directory.
| |
| PathIsEqual |
Tests if two paths are equal.
| |
| PathIsValidFileName |
Determines whether the specified text represents a valid file name.
| |
| PathMakeSystemFolder |
Gives an existing folder the proper attributes to become a system folder.
| |
| PathRemoveEndSlash |
Removes end slash.
| |
| PathRemoveStartSlash |
Removes start slash.
| |
| PathSetCreationTime |
Sets the creation time of a file or directory.
Does nothing if there's nothing a t the given path.
| |
| PathSetCreationTimeUtc |
Sets the creation time of a file or directory.
Does nothing if there's nothing a t the given path.
| |
| PathSetLastAccessTime |
Sets the last access time of a file or directory.
Does nothing if there's nothing a t the given path.
| |
| PathSetLastAccessTimeUtc |
Sets the last access time of a file or directory.
Does nothing if there's nothing a t the given path.
| |
| PathSetLastWriteTime |
Sets the last write time of a file or directory.
Does nothing if there's nothing a t the given path.
| |
| PathSetLastWriteTimeUtc |
Sets the last write time of a file or directory.
Does nothing if there's nothing a t the given path.
| |
| PathToValidFileName |
Converts a text into a valid file name.
| |
| PathToValidFilePath |
Converts a text into a valid file path.
| |
| PathUnmakeSystemFolder |
Removes the attributes from a folder that make it a system folder. This folder must actually exist in the file system.
| |
| StripTerminatingPathSeparators |
Strips the terminating path separators.
| |
| ToFullString |
Gets a string representing all file attributes, including undeclared ones.
| |
| UrlCombine |
Combines url.
| |
| WrapSharingViolations(Action, IOUtilitiesWrapSharingViolationsExceptionsCallback, Int32, Int32) |
Calls IO code under a sharing violations handling system.
| |
| WrapSharingViolationsT(FuncT, IOUtilitiesWrapSharingViolationsExceptionsCallbackT, Int32, Int32) |
Calls IO code under a sharing violations handling system.
| |
| WrapSharingViolationsAsync(FuncTask, IOUtilitiesWrapSharingViolationsExceptionsCallbackAsync, Int32, Int32) |
Calls IO code under a sharing violations handling system.
| |
| WrapSharingViolationsAsyncT(FuncTaskT, IOUtilitiesWrapSharingViolationsExceptionsCallbackAsyncT, Int32, Int32) |
Calls IO code under a sharing violations handling system.
|
| Name | Description | |
|---|---|---|
| DefaultWrapSharingViolationsRetryCount |
The default wrap sharing violations retry count value (10).
| |
| DefaultWrapSharingViolationsWaitTime |
The default wrap sharing violations wait time value (100).
| |
| LongFileNamePrefix |
The long file name prefix "\\?\".
| |
| MinFileTime |
The minimum Windows file time value.
|