beautypg.com

Dwfile.setattributes(), Dwfile.write() – Adobe Dreamweaver API Reference CS5 User Manual

Page 17

background image

12

DREAMWEAVER API REFERENCE

The file I/O API

Last updated 8/27/2013

DWfile.setAttributes()

Availability
Dreamweaver MX.

Description
This function sets the system-level attributes of a particular file.

Arguments
fileURL, strAttrs

The fileURL argument, which is expressed as a file:// URL, identifies the file for which you are setting the attributes.

The strAttrs argument specifies the system-level attributes for the file that is identified by the fileURL argument.
The following table describes valid attribute values and their meaning:

Acceptable values for the

strAttrs

string are

R

,

W

,

H

,

V

,

RH

,

RV

,

WH

, or

WV

.

You should not use

R

and

W

together because they are mutually exclusive. If you combine them,

R

becomes

meaningless, and the file is set as writable (

W

). You should not use

H

and

V

together because they are also mutually

exclusive. If you combine them,

H

becomes meaningless, and the file is set as visible (

V

).

If you specify

H

or

V

without specifying an

R

or

W

read/write attribute, the existing read/write attribute for the file is

not changed. Likewise, if you specify

R

or

W

, without specifying an

H

or

V

visibility attribute, the existing visibility

attribute for the file is not changed.

Returns
Nothing.

DWfile.write()

Availability
Dreamweaver 2.

Description
This function writes the specified string to the specified file. If the specified file does not yet exist, it is created.

Arguments

fileURL

,

text

,

{mode}

The

fileURL

argument, which is expressed as a file://URL, is the file to which you are writing.

Note: If the path contains spaces, this function will not write files.

Attribute Value

Description

R

Read only

W

Writable (overrides

R

)

H

Hidden

V

Visible (overrides

H

)