![]() |
Überprüfen eines Pfades auf seine Gültigkeit?
Hallo!
Wie kann ich einen Pfad auf seine Existens Überprüfen? Danke im vorraus! Gruß 1PM |
DirectoryExists.
|
Moin Zusammen,
wobei die Art und Weise, wie DirectoryExists unter D5 implementiert ist, unter Windows ME nicht unbedingt funktioniert (warum auch immer). So sollte es gehen:
Delphi-Quellcode:
function DirectoryExists(const AsDirectory : string): boolean;
const INVALID_FILE_ATTRIBUTES = DWORD(-1); var dwResult : DWORD; begin Result := false; dwResult := GetFileAttributes(PChar(AsDirectory)); if dwResult = INVALID_FILE_ATTRIBUTES then exit; Result := (dwResult and FILE_ATTRIBUTE_DIRECTORY) = FILE_ATTRIBUTE_DIRECTORY; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 15:26 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz