File_Sync
Description
Section titled “Description”Synchronizes files and directories between two directories. After the synchronization, the target directory is a copy of the source directory.
Syntax
Section titled “Syntax”File_Sync(sSourceDir, sTargetDir, iBandwithUtilization, aExcludedDirectories, aExcludedFiles) As Boolean
Parameters
Section titled “Parameters”sSourceDir (String)
Section titled “sSourceDir (String)”Directory that files should be synchronized from
sTargetDir (String)
Section titled “sTargetDir (String)”Directory that files should be synchronized to
iBandwithUtilization (Integer)
Section titled “iBandwithUtilization (Integer)”No longer supported. The value is ignored, but the parameter must still be passed, for example 100.
aExcludedDirectories (Array)
Section titled “aExcludedDirectories (Array)”Names of directories that should be excluded, for example Array("Printers"). A directory with that name is skipped at any level.
aExcludedFiles (Array)
Section titled “aExcludedFiles (Array)”Names of files that should be excluded, for example Array("tip.htm"). A file with that name is skipped in every directory.
Remarks
Section titled “Remarks”- The source directory must exist. If it doesn’t, the function returns False. The target directory is created if it doesn’t exist.
- All attributes, such as read-only, are removed from the files and directories in the target before the synchronization.
- A file is copied if it doesn’t exist in the target, or if its modified date differs from the file in the target.
- Names in the exclusion lists are compared without regard to case. Wildcards aren’t supported.
Example
Section titled “Example”Dim aExcludeDir, aExcludeFileaExcludeDir = Array("Printers", "Wallpaper")aExcludeFile = Array("tip.htm", "tips.gif", "bullet.gif")
If bStatus Then bStatus = File_Sync("C:\CapaInstaller", "C:\Web", 100, aExcludeDir, aExcludeFile)Related functions
Section titled “Related functions”File_CopyTree File_DelTree File_VerCopy Constants Package Property Variables