Autor Beitrag
maze2k
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 252

WIN 95, WIN NT 4.0, WIN 98, WIN 98SE, WIN 2000, RedHat Linux 7.3, Mandrake Linux 9.2, Knoppix Linux 3.3
D6 Pers
BeitragVerfasst: Do 27.11.03 18:15 
Hi,
wie kann ich herausfinden ob ein bestimmtes Verzeichnis existiert?

Im Forum und in der Hilfe hab ich nichts gefunden dazu...

_________________
Wer das Konzept der Unendlichkeit verstehen will, muss nur das Ausmaß menschlicher Dummheit betrachten. (Voltaire)
Henry
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 619

WinXP Prof. SP3
D6 Prof.
BeitragVerfasst: Do 27.11.03 18:30 
Hi,
Versuch es mal mit
ausblenden Delphi-Quelltext
1:
2:
3:
4:
If DirectoryExists('C:\Verzeichnis') then
Begin
 ...
End;

Ich denke das ist es was Du suchst

_________________
mfg Henry
maze2k Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 252

WIN 95, WIN NT 4.0, WIN 98, WIN 98SE, WIN 2000, RedHat Linux 7.3, Mandrake Linux 9.2, Knoppix Linux 3.3
D6 Pers
BeitragVerfasst: Do 27.11.03 18:35 
*lol* ich Depp,
genau danach hab ich in der Hilfe gesucht, es gibt ja auch fileexists...
aber irgendwie hab ich das überlesen ;)

thx *g*

_________________
Wer das Konzept der Unendlichkeit verstehen will, muss nur das Ausmaß menschlicher Dummheit betrachten. (Voltaire)
MathiasSimmack
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 27.11.03 22:07 
Wenn du ein kleines Programm schreiben willst (bspw. nonVCL oder ein Konsolentool), dann empfehle ich die API-Funktion "FindFirstFile", die sich entgegen dem Namen auch problemlos für Ordner benutzen lässt:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
function fileexists(const szFilename: string): boolean;
var
  Handle   : THandle;
  FindData : TWin32FindData;
begin
  Handle := FindFirstFile(pchar(szFilename),FindData);
  Result := (Handle <> INVALID_HANDLE_VALUE);

  if(Result) then Windows.FindClose(Handle);
end;

Ausprobieren. :)