Click or drag to resize

FilePath Methods

The FilePath type exposes the following members.

Methods
  Name Description
Public method Static member AddPathSuffix Makes sure path is suffixed with standard DirectorySeparatorChar.
Public method Static member ApplyInheritableDirectoryPermissions Replaces the permissions of the directory at the given targetPath with the inheritable permissions from the directory at the given sourcePath.
Public method Static member ApplyInheritableFilePermissions Replaces the permissions of the file at the given targetPath with the inheritable permissions from the directory at the given sourcePath.
Public method Static member ApplyInheritablePermissions Replaces the permissions of the directory or file at the given targetPath with the inheritable permissions from the directory at the given sourcePath.
Public method Static member ConnectToNetworkShare Connects to a network share with the specified user's credentials.
Public method Static member CopyDirectoryPermissions Copies the permissions of the directory at the given sourcePath to the directory at the given targetPath.
Public method Static member CopyFilePermissions Copies the permissions of the file at the given sourcePath to the file at the given targetPath.
Public method Static member CopyPermissions Copies permissions from the object at the given sourcePath to the object at the given targetPath.
Public method Static member DisconnectFromNetworkShare(String) Disconnects the specified network share.
Public method Static member DisconnectFromNetworkShare(String, Boolean) Disconnects the specified network share.
Public method Static member DropPathRoot Remove any path root present in the path.
Public method Static member EnumerateDirectories(DirectoryInfo, String, SearchOption, ActionException) Returns an enumerable collection of subdirectories that match a search pattern in a specified path, and optionally searches subdirectories.
Public method Static member EnumerateDirectories(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 method Static member EnumerateFiles(DirectoryInfo, String, SearchOption, ActionException) Returns an enumerable collection of files that match a search pattern in a specified path, and optionally searches subdirectories.
Public method Static member EnumerateFiles(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 method Static member GetAbsolutePath Gets the absolute file path for the specified file name or relative file path.
Public method Static member GetApplicationDataFolder Gets the path to the folder where data related to the current application can be stored.
Public method Static member GetAvailableFreeSpace Tries to get the free space values for a given path. This path can be a network share or a mount point.
Public method Static member GetCommonApplicationDataFolder Gets the path to the folder where data related to the current application can be stored as well as shared among different users.
Public method Static member GetDirectories(DirectoryInfo, String, SearchOption, ActionException) Returns the subdirectories that match the specified search pattern in the specified directory, and optionally searches subdirectories.
Public method Static member GetDirectories(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 method Static member GetDirectoryName Gets the directory information from the specified file path.
Public method Static member GetExtension Gets the extension from the specified file path.
Public method Static member GetFileLength Gets the size of the specified file.
Public method Static member GetFileList 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 method Static member GetFileLockT Gets a lock on the file using the given lock function.
Public method Static member GetFileName Gets the file name and extension from the specified file path.
Public method Static member GetFileNameWithoutExtension Gets the file name without extension from the specified file path.
Public method Static member GetFilePatternRegularExpression Gets a regular expression pattern that simulates wildcard matching for filenames (wildcards are defined as '*' or '?' characters).
Public method Static member GetFiles(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 method Static member GetFiles(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 method Static member GetLastDirectoryName Gets the last directory name from a file path.
Public method Static member GetUniqueFilePath 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 method Static member GetUniqueFilePathWithBinarySearch 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 method Static member GetValidFileName Gets a valid file name by replacing invalid file name characters with replaceWithCharacter.
Public method Static member GetValidFilePath Gets a valid file path by replacing invalid file or directory name characters with replaceWithCharacter.
Public method Static member InApplicationPath Determines if the specified filePath is contained with the current executable path.
Public method Static member IsFilePatternMatch(String, String, Boolean) Determines whether the specified file name matches the given file spec (wildcards are defined as '*' or '?' characters).
Public method Static member IsFilePatternMatch(String, String, Boolean) Determines whether the specified file name matches any of the given file specs (wildcards are defined as '*' or '?' characters).
Public method Static member IsValidFileName Determines if the specified file name and path is valid.
Public method Static member RemovePathSuffix Makes sure path is not suffixed with DirectorySeparatorChar or AltDirectorySeparatorChar.
Public method Static member ResetPermissions Sets the permissions of the file or directory at the given path to the object's inherited permissions.
Public method Static member TrimFileName Returns a file name, for display purposes, of the specified length using "..." to indicate a longer name.
Public method Static member TryGetReadLock Attempts to get read access on a file.
Public method Static member TryGetReadLockExclusive Attempts to get read access on a file.
Public method Static member TryGetWriteLock Attempts to get write access on a file.
Public method Static member ValidatePathName Ensures the supplied path name is valid.
Public method Static member WaitForReadLock(String) Waits for the default duration (5 seconds) for read access on a file.
Public method Static member WaitForReadLock(String, Double) Waits for read access on a file for the specified number of seconds.
Public method Static member WaitForReadLockExclusive(String) Waits for the default duration (5 seconds) for read access on a file.
Public method Static member WaitForReadLockExclusive(String, Double) Waits for read access on a file for the specified number of seconds.
Public method Static member WaitForWriteLock(String) Waits for the default duration (5 seconds) for write access on a file.
Public method Static member WaitForWriteLock(String, Double) Waits for write access on a file for the specified number of seconds.
Public method Static member WaitTillExists(String) Waits for the default duration (5 seconds) for a file to exist.
Public method Static member WaitTillExists(String, Double) Waits for a file to exist for the specified number of seconds.
Top
See Also