Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Warum kopiert der nicht per CopyFile ? (https://www.delphipraxis.net/10474-warum-kopiert-der-nicht-per-copyfile.html)

Rapthor 19. Okt 2003 14:18


Warum kopiert der nicht per CopyFile ?
 
Ich habe folgendes in meinem Quelltext:

Delphi-Quellcode:
CopyFile(PChar(Edit2.Text + '\' + 'macros.txt'), PChar(Edit2.Text + '\' + tempdir + '\' + Kuerzel.Text), true);
Aber obwohl die Verzeichnisse Hundertpro existieren, kopiert er die macros.txt nicht. (Ja auch die Datei existiert, hab mich davon überzeugt!) Was ist denn daran falsch ?

Christian Seehase 19. Okt 2003 14:21

Re: Warum kopiert der nicht per CopyFile ?
 
Moin Rapthor,

probier mal das:

Delphi-Quellcode:
if not CopyFile(......) then begin
  ShowMessage(SysErrorMessage(GetLastError));
end;
Dann kannst Du die Ursache vielleicht erkennen.

[EDIT]
Kuerzel.Text enthält doch auch den Zieldateinamen, oder?
[/EDIT]

Rapthor 19. Okt 2003 14:24

Re: Warum kopiert der nicht per CopyFile ?
 
Ups .. nö.
Ich kopiere nur in ein Verzeichnis ohne Angabe des Zieldateinamens .... Danke. Wird daran liegen ! :lol:


Alle Zeitangaben in WEZ +1. Es ist jetzt 20:10 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz