RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
SysUtils.ExtractFileDrive Function

Returns the drive portion of a file name.

Pascal
function ExtractFileDrive(const FileName: string): string;
C++
AnsiString ExtractFileDrive(const AnsiString FileName);

SysUtils

Note: On Windows, ExtractFileDrive returns a string containing the drive portion of a fully qualified path name for the file passed in the FileName. For file names with drive letters, the result is in the form "'<drive>'". For file names with a UNC path the result is in the form "'\\<servername>\<sharename>'". If the given path contains neither style of path prefix, the result is an empty string.
Note: On Linux, ExtractFileDrive always returns a zero-length string.
 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!