<cfdirectory>

Handles interactions with directories.

This tag cannot have a body.

This tag is also supported within <cfscript>

Attribute Description Default
filterdelimiters
string, optional

Optional when passing a filter pattern. This value is used as a delimiter for the patterns. Default is the pipe "|" character.

mode
string, optional

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.

createpath
boolean, optional

if set to false, expects all parent directories to exist, true (default) will generate necessary directories

sort
string, optional

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

filter
any, optional

Optional for action = "list". Ignored by all other actions. Can be either a wildcard filter, e.g. "m*", or a UDF/Closure which accepts the file/directory name and returns a boolean value to indicate whether that item should be included in the result or not.

directory
string, required

The name of the directory to perform the action against.

serverpassword
string, optional

allow you to access filesystem, also when access is denied for your context

recurse
boolean, optional

Whether Lucee performs the action on subdirectories

listinfo
string, optional
  • all: includes all information in the result set.
  • name: includes only filenames in the result set.
nameconflict
string, optional

When used with action="copy" the possible values are: [Overwrite]|Error. When used with action="create" the possible values are: [Error]|Skip. Ignored for all other actions.

storeacl
object, optional

An array of struct where each struct represents a permission or grant. Example: [{email="xxx@yyy.com", permission="full_control"}, {group="all", permission="read"}]

name
string, optional

Required for action = "list". Ignored by all other actions. Name of output query for directory listing.

type
string, optional
  • file: includes only filenames.
  • dir: includes only directory names.
  • all: includes both filenames and directory names.
storelocation
string, optional

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.

destination
string, optional

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.

action
string, optional

Defines the action to be taken with directory(ies) specified in directory.

[list|create|delete|rename]

list

newdirectory
string, optional

Required for action = "rename". Ignored by all other actions. The new name of the directory specified in the directory attribute.

<cfdirectory
    [filterdelimiters=string]
    [mode=string]
    [createpath=boolean]
    [sort=string]
    [filter=any]
    directory=string
    [serverpassword=string]
    [recurse=boolean]
    [listinfo=string]
    [nameconflict=string]
    [storeacl=object]
    [name=string]
    [type=string]
    [storelocation=string]
    [destination=string]
    [action=list|create|delete|forcedelete|rename|copy]
    [newdirectory=string]
>

Examples

There are currently no examples for this tag.

See also