Click or drag to resize

FilePath Class

Contains File and Path manipulation methods.
Inheritance Hierarchy
SystemObject
  GSF.IOFilePath

Namespace: GSF.IO
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.181-beta
Syntax
public static class FilePath
View Source

The FilePath type exposes the following members.

Methods
 NameDescription
Public methodStatic memberAddPathSuffix Makes sure path is suffixed with standard DirectorySeparatorChar.
Public methodStatic memberApplyInheritableDirectoryPermissions Replaces the permissions of the directory at the given targetPath with the inheritable permissions from the directory at the given sourcePath.
Public methodStatic memberApplyInheritableFilePermissions Replaces the permissions of the file at the given targetPath with the inheritable permissions from the directory at the given sourcePath.
Public methodStatic memberApplyInheritablePermissions Replaces the permissions of the directory or file at the given targetPath with the inheritable permissions from the directory at the given sourcePath.
Public methodStatic memberConnectToNetworkShare Connects to a network share with the specified user's credentials.
Public methodStatic memberCopyDirectoryPermissions Copies the permissions of the directory at the given sourcePath to the directory at the given targetPath.
Public methodStatic memberCopyFilePermissions Copies the permissions of the file at the given sourcePath to the file at the given targetPath.
Public methodStatic memberCopyPermissions Copies permissions from the object at the given sourcePath to the object at the given targetPath.
Public methodStatic memberDisconnectFromNetworkShare(String) Disconnects the specified network share.
Public methodStatic memberDisconnectFromNetworkShare(String, Boolean) Disconnects the specified network share.
Public methodStatic memberDropPathRoot Remove any path root present in the path.
Public methodStatic memberEnumerateDirectories(DirectoryInfo, String, SearchOption, ActionException) Returns an enumerable collection of subdirectories that match a search pattern in a specified path, and optionally searches subdirectories.
Public methodStatic memberEnumerateDirectories(String, String, SearchOption, ActionException) Returns an enumerable collection of file names that match a search pattern in a specified path, and optionally searches subdirectories.
Public methodStatic memberEnumerateFiles(DirectoryInfo, String, SearchOption, ActionException) Returns an enumerable collection of files that match a search pattern in a specified path, and optionally searches subdirectories.
Public methodStatic memberEnumerateFiles(String, String, SearchOption, ActionException) Returns an enumerable collection of file names that match a search pattern in a specified path, and optionally searches subdirectories.
Public methodStatic memberGetAbsolutePath Gets the absolute file path for the specified file name or relative file path.
Public methodStatic memberGetApplicationDataFolder Gets the path to the folder where data related to the current application can be stored.
Public methodStatic memberGetAvailableFreeSpace Tries to get the free space values for a given path. This path can be a network share or a mount point.
Public methodStatic memberGetCommonApplicationDataFolder Gets the path to the folder where data related to the current application can be stored as well as shared among different users.
Public methodStatic memberGetDirectories(DirectoryInfo, String, SearchOption, ActionException) Returns the subdirectories that match the specified search pattern in the specified directory, and optionally searches subdirectories.
Public methodStatic memberGetDirectories(String, String, SearchOption, ActionException) Returns the names of the subdirectories (including their paths) that match the specified search pattern in the specified directory, and optionally searches subdirectories.
Public methodStatic memberGetDirectoryName Gets the directory information from the specified file path.
Public methodStatic memberGetExtension Gets the extension from the specified file path.
Public methodStatic memberGetFileLength Gets the size of the specified file.
Public methodStatic memberGetFileList Gets a list of files under the specified path. Search wildcard pattern (c:\Data\*.dat) can be used for including only the files matching the pattern or path wildcard pattern (c:\Data\*\*.dat) to indicate the inclusion of files under all subdirectories in the list.
Public methodStatic memberGetFileLockT Gets a lock on the file using the given lock function.
Public methodStatic memberGetFileName Gets the file name and extension from the specified file path.
Public methodStatic memberGetFileNameWithoutExtension Gets the file name without extension from the specified file path.
Public methodStatic memberGetFilePatternRegularExpression Gets a regular expression pattern that simulates wildcard matching for filenames (wildcards are defined as '*' or '?' characters).
Public methodStatic memberGetFiles(DirectoryInfo, String, SearchOption, ActionException) Returns the files that match the specified search pattern in the specified directory, using a value to determine whether to search subdirectories.
Public methodStatic memberGetFiles(String, String, SearchOption, ActionException) Returns the names of files (including their paths) that match the specified search pattern in the specified directory, using a value to determine whether to search subdirectories.
Public methodStatic memberGetLastDirectoryName Gets the last directory name from a file path.
Public methodStatic memberGetUniqueFilePath Gets a unique file path for the given file by checking for name collisions and adding a sequence number to the end of the file name if there is a collision.
Public methodStatic memberGetUniqueFilePathWithBinarySearch Gets a unique file path for the given file by checking for name collisions and adding a sequence number to the end of the file name if there is a collision.
Public methodStatic memberGetValidFileName Gets a valid file name by replacing invalid file name characters with replaceWithCharacter.
Public methodStatic memberGetValidFilePath Gets a valid file path by replacing invalid file or directory name characters with replaceWithCharacter.
Public methodStatic memberInApplicationPath Determines if the specified filePath is contained with the current executable path.
Public methodStatic memberIsFilePatternMatch(String, String, Boolean) Determines whether the specified file name matches the given file spec (wildcards are defined as '*' or '?' characters).
Public methodStatic memberIsFilePatternMatch(String, String, Boolean) Determines whether the specified file name matches any of the given file specs (wildcards are defined as '*' or '?' characters).
Public methodStatic memberIsValidFileName Determines if the specified file name and path is valid.
Public methodStatic memberRemovePathSuffix Makes sure path is not suffixed with DirectorySeparatorChar or AltDirectorySeparatorChar.
Public methodStatic memberResetPermissions Sets the permissions of the file or directory at the given path to the object's inherited permissions.
Public methodStatic memberTrimFileName Returns a file name, for display purposes, of the specified length using "..." to indicate a longer name.
Public methodStatic memberTryGetReadLock Attempts to get read access on a file.
Public methodStatic memberTryGetReadLockExclusive Attempts to get read access on a file.
Public methodStatic memberTryGetWriteLock Attempts to get write access on a file.
Public methodStatic memberValidatePathName Ensures the supplied path name is valid.
Public methodStatic memberWaitForReadLock(String) Waits for the default duration (5 seconds) for read access on a file.
Public methodStatic memberWaitForReadLock(String, Double) Waits for read access on a file for the specified number of seconds.
Public methodStatic memberWaitForReadLockExclusive(String) Waits for the default duration (5 seconds) for read access on a file.
Public methodStatic memberWaitForReadLockExclusive(String, Double) Waits for read access on a file for the specified number of seconds.
Public methodStatic memberWaitForWriteLock(String) Waits for the default duration (5 seconds) for write access on a file.
Public methodStatic memberWaitForWriteLock(String, Double) Waits for write access on a file for the specified number of seconds.
Public methodStatic memberWaitTillExists(String) Waits for the default duration (5 seconds) for a file to exist.
Public methodStatic memberWaitTillExists(String, Double) Waits for a file to exist for the specified number of seconds.
Top
See Also