.
function Subst(Drive:char;Path:string):boolean;
var
zPathName:array[0..80] of char;
zDrvStr:array[0..5] of char;
Flags:dWord;
begin
Flags:=0;
zDrvStr[0]:=Drive; zDrvStr[1]:=':'; zDrvStr[2]:=#0;
if (Path='/d') or
(Path='/D')
then begin
Flags:=DDD_REMOVE_DEFINITION or DDD_RAW_TARGET_PATH;
QueryDOSDevice(zDrvStr,zPathName,sizeof(zPathName));
end else begin
if not(DirectoryExists(Path)) then begin
Result:=false; exit;
end;
StrPCopy(zPathName,Path);
end;
Result:=DefineDOSDevice(Flags,zDrvStr,zPathName);
end; (* Subst *)
|