Sign in Join
Wiki copytemporary

CopyFile/fr

English · Français · Suomi · Русский

Unité: Lazarus fileutil (Remplacements UTF-8 pour le code FPC RTL et la gestion supplémentaire de fichiers/répertoires)

pascal
// flags for copy
type
 TCopyFileFlag = (
   cffOverwriteFile,
   cffCreateDestDirectory,
   cffPreserveTime
   );
 TCopyFileFlags = set of TCopyFileFlag;

function CopyFile(const SrcFilename, DestFilename: string): boolean;
function CopyFile(const SrcFilename, DestFilename: string; PreserveTime: boolean): boolean;
function CopyFile(const SrcFilename, DestFilename: string; Flags: TCopyFileFlags=[cffOverwriteFile]): boolean;

copyfile copie un fichier source vers un emplacement de fichier destination. Optionnellement, il préserve l'estampille horaire du fichier.

Exemple:

pascal
uses 
...
fileutil
...
CopyFile('c:\autoexec.bat','c:\windows\temp\autoexec.bat.backup');

Résultat de la fonction : Retourne True en cas de succès, False si une erreur a eu lieu.

Note: Si vous voulez utiliser cette fonction dans un programme en ligne de commande, ajoutez une exigence de projet pour LazUtils, lequel ne tirera pas dedans la LCL entière


From the Free Pascal wiki, page "CopyFile/fr", as it stood on 2020-02-12 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 1, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.