From 9a1052e1be8d3f34966fdbc16a440b38cc57173d Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 8 Oct 2005 13:49:30 +0000 Subject: [PATCH] =?UTF-8?q?+=20Patch=20from=20Luiz=20Am=C3=A9rico=20to=20f?= =?UTF-8?q?ix=20direxists?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: trunk@1334 - --- rtl/win32/sysutils.pp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/rtl/win32/sysutils.pp b/rtl/win32/sysutils.pp index 8ce1da2908..5fd457c2da 100644 --- a/rtl/win32/sysutils.pp +++ b/rtl/win32/sysutils.pp @@ -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;