Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Wie kann ich Dateien überschreiben? (https://www.delphipraxis.net/32142-wie-kann-ich-dateien-ueberschreiben.html)

roxxy 19. Okt 2004 13:17


Wie kann ich Dateien überschreiben?
 
Hi Leutz,

Wie kann ich bei einem Kopiervorgang Dateien überschreiben, ohne das ich Fehlermeldung bekomme, oder etwas ähnliches.




Thx schon mal

Luckie 19. Okt 2004 13:21

Re: Wie kann ich Dateien überschreiben?
 
Guck dir mal den letzten Paramter von MSDN-Library durchsuchencopyfile an, der sollte das regeln, wenn mich nicht alles täuscht.

roxxy 19. Okt 2004 13:25

Re: Wie kann ich Dateien überschreiben?
 
Meinste das geht??

ich habe mir das mal angeschaut, aber nix gerafft, weil ich noch n newbi auf diesem gebiet bin.


:coder2:

Ultimator 19. Okt 2004 13:28

Re: Wie kann ich Dateien überschreiben?
 
Im WinAPI-SDK steht:
BOOL CopyFile(

LPCTSTR lpExistingFileName, // pointer to name of an existing file
LPCTSTR lpNewFileName, // pointer to filename to copy to
BOOL bFailIfExists // flag for operation if file exists
);

Weiterhin steht dort:
Parameters

lpExistingFileName

Points to a null-terminated string that specifies the name of an existing file.

lpNewFileName

Points to a null-terminated string that specifies the name of the new file.

bFailIfExists

Specifies how this operation is to proceed if a file of the same name as that specified by lpNewFileName already exists. If this parameter is TRUE and the new file already exists, the function fails. If this parameter is FALSE and the new file already exists, the function overwrites the existing file and succeeds

D.h., wenn du als letzten Parameter false angibst, wird die Datei überschrieben ;-)

roxxy 19. Okt 2004 13:37

Re: Wie kann ich Dateien überschreiben?
 
Keine Ahnung, von dem, was du da geschrieben hast, aber es wird schon irgendwie klappen.

:wiejetzt:




thx

Ultimator 19. Okt 2004 13:43

Re: Wie kann ich Dateien überschreiben?
 
Das was ich geschrieben habe, steht im Win32API-SDK.

Weil du's bist (naja, eigentlich ist mir nur gerade danach :mrgreen:):
Delphi-Quellcode:
CopyFile('ZuKopierendeDa.tei','ZuErstellendeDa.tei',false);
Das false bewirkt, wie schon gesagt, dass eine evtl vorhandene ZuErstellendeDa.tei überschrieben wird.

roxxy 19. Okt 2004 14:41

Re: Wie kann ich Dateien überschreiben?
 
THX


Alle Zeitangaben in WEZ +1. Es ist jetzt 14:57 Uhr.

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