Chapter 2: the file i/o api, About configuration folders, About the file i/o api – Adobe Dreamweaver API Reference CS5 User Manual
Page 10: Dwfile.copy()

5
Last updated 8/27/2013
Chapter 2: The file I/O API
Adobe® Dreamweaver® CS5 includes a C shared library called DWfile. The DWfile lets authors of objects, commands,
behaviors, data translators, floating panels, and Property inspectors read and write files on the local file system. The
chapter describes the File I/O API and how to use it.
For general information on how C libraries interact with the JavaScript interpreter in Dreamweaver, see “C-Level
Extensibility” in Extending Dreamweaver.
About configuration folders
On Microsoft Windows 2000 and Windows XP, and Mac OS X platforms, users have their own copies of configuration
files. Whenever Dreamweaver writes to a configuration file, Dreamweaver writes it to the user’s Configuration folder.
Similarly, when Dreamweaver reads a configuration file, Dreamweaver searches for it first in the user’s Configuration
folder and then in the Dreamweaver Configuration folder. DWfile functions use the same mechanism. In other words,
if your extension reads or writes a file in the Dreamweaver Configuration folder, your extension also accesses the user’s
Configuration folder. For more information about configuration folders on multiuser platforms, see Extending
Dreamweaver.
About the file I/O API
All functions in the file I/O API are methods of the
DWfile
object.
DWfile.copy()
Availability
Dreamweaver 3.
Description
This function copies the specified file to a new location.
Arguments
originalURL, copyURL
•
The originalURL argument, which is expressed as a file:// URL, is the file you want to copy.
•
The copyURL argument, which is expressed as a file:// URL, is the location where you want to save the copied file.
Returns
A Boolean value:
true
if the copy succeeds;
false
otherwise.
Example
The following code copies a file called myconfig.cfg to myconfig_backup.cfg: