Allows you to list, create, delete or rename a directory in the server file system.
<cfdirectory directory="." action="list|create|delete|rename">
directoryList(".", false, " ");
list
list
create
delete
rename
asc
asc
desc
false
all
dir
file
all
all
name
all
Returns a query
myList = directoryList(expandPath("./"), false, "query");
directoryCreate(expandPath("./new_directory"));
Directory Delete
directoryDelete(expandPath("./my_directory"));
directoryRename(expandPath("./my_directory"), expandPath("./new_directory"));
Directory List
<cfdirectory action="list" directory="#expandPath("./")#" recurse="false" name="myList">
<cfdirectory action="create" directory="#expandPath("./new_directory")#">
<cfdirectory action="delete" directory="#expandPath("./my_directory")#">
<cfdirectory action="rename" directory="#expandPath("./my_directory")#" newdirectory="#expandPath("./new_directory")#">
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.