Copies a file.
# Metadata
Platforms: desktop, server OS: mac, windows, linux Introduced: 1.1.1 Security:
# Syntax
revCopyFile fileToCopy, folderToCopyTo
# Params
- fileToCopy : The fileToCopy specifies the name and location of the file. If you specify a name but not a location, LiveCode assumes the file is in the defaultFolder. - folderToCopyTo : The folderToCopyTo specifies the name and location of the folder where the copied file should be placed. If you specify a name but not a location, LiveCode assumes the destination folder is in the defaultFolder.
# Examples
revCopyFile "/Disk/myfile","/Disk/Folder/"
revCopyFile "data/settings.txt","olddata"
revCopyFile the sourceFile of this card, it
# Description
Use the revCopyFile command to make a copy of a file to another folder.
>*Important:* Use this command to copy a application bundle on > OS X
put URL "binfile:/Disk/myfile" into URL "binfile:/Disk/Folder/myfile"
However, the revCopyFile command provides certain advantages. It copies file attributes (such as type signature) and Mac OS resource forks along with the file. It also does not require reading the entire file into memory, so even extremely large files can be copied.
>*Note:* In a standalone application the Common library is implemented > as a hidden group and made available when the group receives its > first openBackground message. During the first part of the > application startup process, before this message is > sent, the revCopyFile command is not yet available. This may > affect attempts to use this command in startup, preOpenStack, > openStack, or preOpenCard handlers in the main stack. > Once the application has finished starting up, the library is > available and the revCopyFile command can be used in any > handler.
# Tags
# See
- **message:** startup, openBackground, preOpenStack, openStack, preOpenCard - **library:** Common library, library - **keyword:** resfile, file, binfile - **control structure:** function - **function:** result - **command:** rename, answer file, create alias - **glossary:** application bundle, type signature, Unix, command, main stack, folder, file, return, group, message, statement, Mac OS, shell, OS X, AppleScript, platform, application, resource fork, handler, Windows