Adobe ColdFusion 8

FileSetAttribute

Description

Sets the attributes of a file in Windows.

Category

System functions

Function syntax

FileSetAttribute(filepath, attribute)

See also

FileCopy, FileDelete, FileExists, FileMove

History

ColdFusion 8: Added this function.

Parameters

Parameter

Description

filepath

An absolute path to a file on the server.

attribute

One of the following:

  • readOnly
  • hidden
  • normal

Set the attribute to normal to make a file not read-only and not hidden.

Example

The following example sets the access mode of a file to be read-only.

<h3>FileSetAttribute Example</h3>

<cfscript>
    FileSetAttribute("c:\temp\test1.txt", "readOnly");
</cfscript>