Sets the attributes of an on-disk file in Windows. This function does not work with in-memory files.
fileSetAttribute(filePath, attribute)
returns void
Name | Type | Required | Default | Description | Values | |
---|---|---|---|---|---|---|
filePath | string | Yes | Path to on-disk file | |||
attribute | string | Yes | Attribute to enable/disable readonly/hidden sets the given attribute to true and the other one to false normal sets both to false |
/Users/garethedwards/development/github/cfdocs/docs/functions/filesetattribute.md | normal |
myFile = getTempFile(getTempDirectory(),"testFile");
writeOutput('is writable: '&getFileInfo(myFile).canWrite);
fileSetAttribute(myFile,'readOnly');
writeOutput(' → '&getFileInfo(myFile).canWrite);