Skip to main content

revCopyFile

Type

command

Summary

Copies a file.

Syntax

revCopyFile <fileToCopy>, <folderToCopyTo>

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.

Parameters

NameTypeDescription

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

function: result

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

keyword: resfile, file, binfile

library: Common library, library

message: startup, openBackground, preOpenStack, openStack, preOpenCard

command: rename, answer file, create alias

control structure: function

Compatibility and Support

Introduced

LiveCode 1.1.1

OS

mac

windows

linux

Platforms

desktop

server

Thank you for your feedback!

Was this page helpful?