Click or drag to resize

FilePathGetDirectoryName Method

Gets the directory information from the specified file path.

Namespace: GSF.IO
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.300-beta+b2186e2cd1f968c931b0e151fdd7c839f3d1e9cf
Syntax
public static string GetDirectoryName(
	string filePath
)
View Source

Parameters

filePath  String
The file path from which the directory information is to be obtained.

Return Value

String
Directory information.
Remarks
This differs from GetDirectoryName(String) in that it will see if last name in path is a directory and, if it exists, will properly treat that part of path as a directory. The .NET path function always assumes last entry is a file name if path is not suffixed with a slash. For example: Path.GetDirectoryName(@"C:\Music") will return "C:\", however, FilePath.GetDirectoryName(@"C:\Music") will return "C:\Music\", so long as Music directory exists.
See Also