Specifications
271
CHAPTER 22
The File I/O API
Macromedia Dreamweaver MX includes a C shared library called DWfile that gives authors
ofobjects, commands, behaviors, data translators, floating panels, and Property inspectors the
ability to read and write files on the local file system. This 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” on page 251.
Accessing configuration folders
On Microsoft Windows NT, Windows 2000, and Windows XP, and on Mac OS X platforms,
users have their own copies of configuration files. Whenever Dreamweaver MX writes to a
configuration file, Dreamweaver writes it to the user’s Configuration folder. Similarly, when
Dreamweaver reads a configuration file, Dreamweaver looks for it first in the user’s Configuration
folder, then in the application’s Configuration folder. DWFile functions use the same
mechanism. In other words, if your extension reads or writes a file in the Configuration folder,
your extension accesses the user's Configuration folder too. For more information about
Configuration folders on multiuser platforms, see “Extension folders” on page 18.
The File I/O API
All functions in the File I/O API are methods of the DWfile object. Optional arguments are
enclosed in braces ({ }). Functions with an availability of 2 were included in the version of DWfile
that was supplied as a download for Dreamweaver 2 from the Macromedia website. This version
of DWfile might have been installed with third-party objects.
DWfile.copy()
Availability
Dreamweaver 3
Description
Copies the specified file to a new location.
Arguments
originalURL, copyURL
• The first argument is the file you want to copy, which is expressed as a file:// URL.
• The second argument is the location where you want to save the copied file, which is expressed
as a file:// URL.