Xbasic

COPY_FOLDER Function

Syntax

Result_Flag as L = copy_folder(C sourcefolder ,C targetfolder [,L only_copy_if_newer ])

Arguments

Result_Flag

.T. = Indicates that the files and folders were copied successfully, .F. = There was an error copying the files.

sourcefolder

The directory to copy. Character

targetfolder

The new location for the copied data. Character

only_copy_if_newer

Logical. Optional. Default = .F. Alpha Anywhere checks to see that the source file is newer than the target file before it copies source to target.

Description

The COPY_FOLDER() function copies all of the files in the Source_Folder to the Target_Folder. If the Target_Folder does not exist, the function creates it. If the Source_Folder has sub-folders, then the same directory structure is automatically created in the Target_Folder. All sub-folders are copied as well.

Example

dim success as L
success = copy_folder("c:\documents\alphafivehelp\\", "\\docserver\a5v6\alphafivehelp - 0200604 - Friday")

See Also