Whatever message this page gives is out now! Go check it out!

FileSetAccessMode

Last update:
May 18, 2026

Description

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

Category

Function syntax

FileSetAccessMode(filepath, mode)

See also

History

ColdFusion 8: Added this function.

Parameters

Parameter
Description
filepath
An absolute path to the file on the server.
mode
A three-digit value, in which each digit specifies the file access for individuals and groups:
  • The first digit represents the owner.
  • The second digit represents a group.
  • The third digit represents anyone. Each digit of this code sets permissions for the appropriate individual or group:
  • 4 specifies read permission.
  • 2 specifies write permission.
  • 1 specifies execute permission. You use the sums of these numbers to indicate combinations of the permissions:
  • 3 specifies write and execute permission.
  • 5 specifies read and execute permission.
  • 6 indicates read and write permission.
  • 7 indicates read, write, and execute permission. For example, 400 specifies that only the owner can read the file; 004 specifies that anyone can read the file.

Example

The following example sets the access mode of a file so that only the owner can read the file.
<h3>FileSetAccessMode Example</h3> 
 
 <cfscript> 
 FileSetAccessMode("test1.txt", "004"); 
 </cfscript>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page