Autor Beitrag
Fischman
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 137

Win XP
D3 Prof / D7
BeitragVerfasst: Di 17.08.04 14:27 
Hallo Leute,
ich möchte wenn ich mein Programm starte einen Ordner erstellen mit MkDir das geht ja auch ganz gut.Wie kann ich dann beim nächsten Start abfragen ob es schon denn Ordner gibt,so das ich nicht alles überschreibe was dann im Ordner liegt.Kann mir da einer weiter helfen.

Gruß Uwe
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: Di 17.08.04 14:34 
ausblenden Delphi-Quelltext
1:
if DirectoryExists(szPfadzumDir) then {...}					


raziel

_________________
JSXGraph
Inferno
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76



BeitragVerfasst: Di 17.08.04 14:35 
probiers mal hiermit

ausblenden Delphi-Quelltext
1:
function DirectoryExists(const Directory: string): Boolean;					


düfte das sein was du suchst ;)

hm, zu langsam :(
*g*


mfg
Inferno
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Di 17.08.04 15:02 
Oder eben ForceDirectories...

Cu,
Udontknow
Fischman Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 137

Win XP
D3 Prof / D7
BeitragVerfasst: Di 17.08.04 18:17 
Werd ich mal testen.

Gruß Uwe
Sprint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 849



BeitragVerfasst: Mi 18.08.04 01:43 
Eine andere Möglichkeit wäre noch, wenn du die WinAPI Funktion MakeSureDirectoryPathExists aus der Unit ImageHlp benutzt.

ausblenden Quelltext
1:
2:
3:
4:
function MakeSureDirectoryPathExists(const S: String): Boolean;
begin
  Result := ImageHlp.MakeSureDirectoryPathExists(PChar(IncludeTrailingPathDelimiter(S)));
end;

_________________
Ciao, Sprint.
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Mi 18.08.04 08:08 
Äh... Was ist da der Unterschied zu ForceDirectories?

Cu,
Udontknow
Fischman Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 137

Win XP
D3 Prof / D7
BeitragVerfasst: Mi 18.08.04 12:05 
Hallo,
das Problem ist gelöst danke an alle.

Gruß Uwe

ausblenden Quelltext
1:
if Not DirectoryExists('C:\Durst') then MkDir('C:\Trinken')					
Sprint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 849



BeitragVerfasst: Mi 18.08.04 12:18 
Udontknow hat folgendes geschrieben:
Äh... Was ist da der Unterschied zu ForceDirectories?

Das Ergebnis ist das gleiche. Wollte nur noch mal 'ne andere Möglichkeit nennen.

_________________
Ciao, Sprint.
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Mi 18.08.04 13:04 
Ja, aber warum sollte man die Unit ImageHlp einbinden, wenn doch sowieso in der Unit SysUtils, die ja fast überall gebraucht wird, die Fkt "ForceDirectories" zur Verfügung steht?

Cu,
Udontknow