Autor Beitrag
Fabian
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 42



BeitragVerfasst: Do 31.10.02 21:14 
Hallo

Wie kann ich ein Verzeichnis erstellen oder prüfen ob ein bestimmtes Verzeichnis schon Vorhanden ist ?

Danke
Popov
Gast
Erhaltene Danke: 1



BeitragVerfasst: Do 31.10.02 21:25 
CreateDir

if DirectoryExists(...) then

Dann gibt es noch eine Funktion mit der man eine Reihe von Ordnern in einem Stück anlegen kann. Der Name fällt mir aber mommentan nicht ein.
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: Do 31.10.02 22:05 
Popov hat folgendes geschrieben:
Dann gibt es noch eine Funktion mit der man eine Reihe von Ordnern in einem Stück anlegen kann. Der Name fällt mir aber mommentan nicht ein.


ForceDirectories ;)

Gruß
Klabautermann
DelphiMan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 73



BeitragVerfasst: So 03.11.02 10:27 
Titel: So...
Hallo zusammen!

Du kannst dir auch selber eine Funktion schreiben, die überprüft ob eine Verzeichnis vorhanden ist. Eine solche sieht in etwa so aus:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
function Directory_Exists(const Name: string): Boolean;
var
 Code: Integer;
begin
 Code := GetFileAttributes(PChar(Name));
 Result := (Code <> -1) and (FILE_ATTRIBUTE_DIRECTORY and Code <> 0);
end;


Benötigst du keine weiteren Dateiroutinen, würd ich es so machen, da du somit nicht die Unit FileCtrl einbinden musst.

MfG
DelphiMan