Chapter 14: Managing Files on the Server
Performing Directory Operations
Use the CFDIRECTORY tag to return file information from a specified directory and to
create, delete, and rename directories.
As with CFFILE, ColdFusion administrators can disable CFDIRECTORY processing in
the ColdFusion Administrator Tags page. See the CFML Language Reference for details
on the syntax of this tag.
Returning file information
When using the ACTION=LIST, CFDIRECTORY returns five result columns you can
reference in your CFOUTPUT:
Name — Directory entry name.
Size — Directory entry size.
Type — File type: F or D for File or Directory.
DateLastModified — Date an entry was last modified.
Attributes — File attributes, if applicable.
Mode — (Solaris only) The octal value representing the permissions setting for
the specified directory. For information about octal values, refer to the man
pages for the chmod shell command.
To view directory information:
1.
Create a new file in Studio.
2.
Modify the file so that it appears as follows:
<HTML>
<HEAD>
</HEAD>
<BODY>
<H2>List Directory Information</H2>
<CFDIRECTORY
<TABLE>
<TR>
</TR>
<TITLE>List Directory Information</TITLE>
DIRECTORY="c:\inetpub\wwwroot\mine"
NAME="mydirectory"
SORT="size ASC, name DESC, datelastmodified">
<TH>Name</TH>
<TH>Size</TH>
<TH>Type</TH>
<TH>Modified</TH>
<TH>Attributes</TH>
<TH>Mode</TH>
229
Need help?
Do you have a question about the COLDFUSION 4.5-DEVELOPING WEB and is the answer not in the manual?