FileSetAttribute

Description

Sets the attributes of an on-disk file in Windows. This function does not work with in-memory files.

Function syntax

FileSetAttribute(filepath, attribute)

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>