revCopyFile |
Type | command |
Dictionary | LCS |
Library | LiveCode Script |
Syntax | revCopyFile <fileToCopy>, <folderToCopyTo>
|
Summary | Copies a file.
|
Introduced | 1.1.1 |
OS | mac, windows, linux |
Platforms | desktop, server |
Parameters | Name | Type | Description |
---|
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.
|
|
Example | revCopyFile "/Disk/myfile","/Disk/Folder/"
revCopyFile "data/settings.txt","olddata"
revCopyFile the sourceFile of this card, it
|
Values | |
Related | 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
|
Description | Use the revCopyFile command to make a copy of a file to
another folder.
Important: Use this command to copy a bundle on
OS X systems
You can also copy a file using the put command, in a statement like
the following:
put URL "binfile:/Disk/myfile" into URL "binfile:/Disk/Folder/myfile"
However, the revCopyFile command provides certain advantages. It
copies file attributes (such as file type) 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's 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 | file system |