Einzelnen Beitrag anzeigen

Glados
(Gast)

n/a Beiträge
 
#1

Fragen zu DirectoryExists

  Alt 22. Okt 2017, 17:08
Ich habe eben bei Google diese DirectoryExists-Alternative gefunden (https://stackoverflow.com/questions/...-xe2-correctly)
Delphi-Quellcode:
 function DirExistsA(const aDirectory: string): Boolean;
 var
  Code: Integer;
 begin
  Code := GetFileAttributesW(PChar(aDirectory));
  Result := (Code <> -1) and (FILE_ATTRIBUTE_DIRECTORY and Code <> 0);
 end;
Sie ist doppelt so schnell wie das Delphi eigene DirectoryExists.
Ich habe keine Einsicht in die Quelltexte von Delphi. Aber ist DirExistsA trotzdem zu gebrauchen? Denn es gibt kein FollowLink als Parameter und außerdem sind das nur zwei mickrige Zeilen.

Geändert von Glados (22. Okt 2017 um 17:13 Uhr)
  Mit Zitat antworten Zitat