mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-04 16:50:55 +02:00
+ Patch from Luiz Américo to fix direxists
git-svn-id: trunk@1334 -
This commit is contained in:
parent
a6b84b93e1
commit
9a1052e1be
@ -259,16 +259,13 @@ end;
|
||||
|
||||
Function DirectoryExists (Const Directory : String) : Boolean;
|
||||
var
|
||||
Handle: THandle;
|
||||
FindData: TWin32FindData;
|
||||
Attr:Dword;
|
||||
begin
|
||||
Result:=False;
|
||||
Handle := FindFirstFile(Pchar(Directory), FindData);
|
||||
If (Handle <> INVALID_HANDLE_VALUE) then
|
||||
begin
|
||||
Result:=((FindData.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY) = FILE_ATTRIBUTE_DIRECTORY);
|
||||
Windows.FindClose(Handle);
|
||||
end;
|
||||
Attr:=GetFileAttributes(PChar(Directory));
|
||||
if Attr <> $ffffffff then
|
||||
Result:= (Attr and FILE_ATTRIBUTE_DIRECTORY) > 0
|
||||
else
|
||||
Result:=False;
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user