Starts the backup operation and returns true, if successful.
function Backup(const Filelist: TStrings; Target: string): boolean;
Description
The constant Filelist must contain the full path names and the file names or wildcards.
Example - this is a valid list of files:
c:\program files\myprogram\myprog.exe
c:\program files\myprogram\data\*.db
c:\program files\myprogram\data\*.xg?
c:\program files\myprogram\data\*.yg?
If you want to include all files in a directory, you must specify the wildcards with *.*
Example:
c:\program files\myprogram\*.* //all files in this directory
If you want to include all files in a directory including all files in all its sub-directories, add a /s to the file mask. Example:
c:\program files\myprogram\*.* /s //include all subdirectories as well
Target must point to a valid archive file name. The archive is created - if an archive with the same name exists, it is overwritten without commitment. There are no rules for the file extension of the archive.
If TBackupFile needs to split the archive on multiple disks, the extension of the archive file changes to ".002" for the second disk, ".003" for the third and so on.
Examples:
a:mybackup.bck
a:\backup_from_today.xyz
c:\program files\myprogram\backupdir\mybackup.001
Example to execute a backup:
backupfile1.backup( listbox1.items, 'A:backup.bck');
Partager