Autor Beitrag
Baaer
Hält's aus hier
Beiträge: 15



BeitragVerfasst: Mo 24.06.02 23:52 
Hallo,
ich möchte alle Dateien aus dem Verzeichnis H:\DCIM\100Olymp
in das Verzeichnis D:\Bilder kopieren. Ich habe nur immer
Prozeduren für einzelne Files gesehen. Aber es gibt
ja bestimmt einen Befehl wenn man ein komplettes Verzeichnis kopieren will oder etwa nicht??
Erst abzufragen welche Dateien im Verzeichnis liegen unde dann diese einzelnt zu kopieren ist etwas aufwändig.



MFG,
Baaer
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: Mo 24.06.02 23:56 
Nein,
Delphi hat einen solchen Befehl nicht aber die API steht dir hilfreich zur Seite. Im Swiss DELPHI Center seht wie's gemacht wird.

Ansonsten könntest du auch eine schöne Rekursionsaufgabe draus machen.

Gruß
Klabautermann
Torsten
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 160



BeitragVerfasst: Di 25.06.02 00:00 
Moinsen!

Kleines Beispiel:
Unit ShellAPI wird benötigt
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
procedure TForm1.Button1Click(Sender: TObject);
var
aSHFOS : TSHFileOpStruct;
  von : array[0..128] of Char;
  nach: array[0..128] of Char;
begin
  // Puffervariablen initialisieren (Doppel-Null!)
  FillChar(aSHFOS, Sizeof(aSHFOS), #0);
  FillChar(von, Sizeof(von), #0);
  FillChar(nach, Sizeof(nach), #0);
  // Ausgangs- und Zielverzeichnis festlegen
  StrPCopy(von, 'C:\quelle');
  StrPCopy(nach, 'C:\ziel');
  with aSHFOS do
  begin
    Wnd := Handle;
    wFunc := FO_COPY;
    pFrom := @von;
    pTo :=@nach;
    fFlags := FOF_NOCONFIRMATION or FOF_RENAMEONCOLLISION;
    fAnyOperationsAborted := False;
    hNameMappings := nil;
    lpszProgressTitle:= nil;
  end;
  ShFileOperation(aSHFOS);
end;


Grüße

Torsten