From Xojo Documentation
| This item was deprecated in version 2019r2.1.
Please use FolderItem.CopyTo as a replacement.
If the FolderItem is a folder, then the folder and its contents are copied into Destination.
If Destination is a file and the file already exists, the copy is cancelled. You need to delete the existing file first. If there is an error, the LastErrorCode property contains an error code.
On Xojo Cloud, FolderItems that are copied using CopyFileTo cannot have their permissions changed. For now, the workaround is to use a Shell command:
The following example method copies a source folderitem to a new destination using CopyFileTo. It returns True if all files in the folder were successfully copied and returns False otherwise.
Var newFolder As FolderItem
If source.IsFolder Then // it's a folder
newFolder = destination.Child(source.Name)
If Not newFolder.Exists Or Not newFolder.IsFolder Then
// folder was not created - stop processing
For Each file As FolderItem In source.Children
If file = Nil Then
If Not CopyFileOrFolder(file, newFolder) Then
// copy operation failed
Else // it's not a folder
If source.LastErrorCode <> 0 Then