fixed DirPathExists (fixes issue #1764)

git-svn-id: trunk@8841 -
This commit is contained in:
vincents 2006-02-27 23:03:54 +00:00
parent 28eed0f0fe
commit c940e1fe2f

View File

@ -473,16 +473,8 @@ begin
end;
function DirPathExists(DirectoryName: string): boolean;
var sr: TSearchRec;
begin
if (DirectoryName<>'')
and (DirectoryName[length(DirectoryName)]=PathDelim) then
DirectoryName:=copy(DirectoryName,1,length(DirectoryName)-1);
if FindFirst(DirectoryName,faAnyFile,sr)=0 then
Result:=((sr.Attr and faDirectory)>0)
else
Result:=false;
FindClose(sr);
Result:=Sysutils.DirectoryExists(ChompPathDelim(DirectoryName));
end;
function ForceDirectory(DirectoryName: string): boolean;