Drive Type From Path

Submitted by:Andery Smith

Date added:03 December, 2013

Category:Delphi

Delphi code to return type of drive that contains the given (full) path.

Tags: return type , drive type , from path

Code Snippet:

function DriveTypeFromPath(const Path: string): Integer;
var
Drive: string; // the drive name
begin
Drive := SysUtils.ExtractFileDrive(Path) + '\';
Result := Integer(Windows.GetDriveType(PChar(Drive)));
end;
 
 

Comments