<cfdirectory>
Handles interactions with directories.
This tag cannot have a body.
This tag is also supported within <cfscript>
<cfdirectory
action=list|create|delete|forceDelete|rename|copy|info
listInfo=string
storeAcl=object
storeLocation=string
type=string
serverPassword=string
directory=string
name=string
filter=any
filterDelimiters=string
mode=string
sort=string
newDirectory=string
destination=string
recurse=boolean
nameConflict=string
createPath=boolean
>
| Attribute | Description | Default |
|---|---|---|
action
string, optional
|
edit
Defines the action to be taken with directory(ies) specified in directory.
|
list |
listInfo
string, optional
|
edit
|
|
storeAcl
object, optional
|
edit
An array of struct where each struct represents a permission or grant. Example: [{email="xxx@yyy.com", permission="full_control"}, {group="all", permission="read"}] Alias: acl |
|
storeLocation
string, optional
|
edit
Only used for S3 Resources. The location of the created bucket/object. The location can either be EU,US or US-WEST. The default location is US. Alias: storage |
|
type
string, optional
|
edit
|
|
serverPassword
string, optional
|
edit
Allow you to access filesystem, also when access is denied for your context |
|
directory
string, required
|
edit
The name of the directory to perform the action against. |
|
name
string, optional
|
edit
Required for action = "list". Ignored by all other actions. Name of output query for directory listing. Alias: variable |
|
filter
any, optional
|
edit
Optional for action = "list". Ignored by all other actions. Can be either:
|
|
filterDelimiters
string, optional
|
edit
Optional when passing a filter pattern. This value is used as a delimiter for the patterns. Default is the pipe "|" character. |
|
mode
string, optional
|
edit
Used with action = "Create" to define the permissions for a directory on UNIX and Linux platforms. Ignored on Windows. Options correspond to the octal values of the UNIX chmod command. From left to right, permissions are assigned for owner, group, and other. |
|
sort
string, optional
|
edit
Optional for action = "list". Ignored by all other actions. The query columns by which to sort the directory listing. Any combination of columns from query output can be specified in comma-separated list. You can specify ASC (ascending) or DESC (descending) as qualifiers for column names. ASC is the default |
|
newDirectory
string, optional
|
edit
Required for action = "rename". Ignored by all other actions. The new name of the directory specified in the directory attribute. |
|
destination
string, optional
|
edit
Required for action = "copy". Ignored by all other actions. Path of the destination directory. If not an absolute path, it is relative to the source directory. |
|
recurse
boolean, optional
|
edit
Whether or not to include the content of any sub-directories |
|
nameConflict
string, optional
|
edit
When used with action="copy" the possible values are:
When used with action="create" the possible values are:
Ignored for all other actions. |
|
createPath
boolean, optional
|
edit
|
Usage Notes
editFor ACF compatibility, on Unix Systems, the mode column is currently not populated for action="list"
Examples
editSimple format for cfdirectory
Directory Create
<cfdirectory action="create" directory="path of directory">
Directory List
<cfdirectory action = "list" directory = "pathOfDirectory" name = "list">
Directory Copy
<cfdirectory action = "copy" directory = "/pathOfDirectory" destination = "/pathOfDirector" nameconflict = "Overwrite" recurse = "true">
Directory Rename
<cfdirectory action = "rename" directory = "pathOfDirectory" newDirectory = "renameOfDirectory">
Directory Delete
<cfdirectory action = "Delete" directory = "pathOfDirectory" >
Directory Forcedelete
<cfdirectory action = "forcedelete" directory = "pathOfDirectory" >
Related System Properties / Environment Variables
- LUCEE_RESOURCE_CHARSET - Default character set for reading from/writing to various resources (files)
Type: string, Default: system charset