Chapter 14: Managing Files on the Server
229
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>
<TITLE>List Directory Information</TITLE>
</HEAD>
<BODY>
<H2>List Directory Information</H2>
<CFDIRECTORY
DIRECTORY="c:\inetpub\wwwroot\mine"
NAME="mydirectory"
SORT="size ASC, name DESC, datelastmodified">
<TABLE>
<TR>
<TH>Name</TH>
<TH>Size</TH>
<TH>Type</TH>
<TH>Modified</TH>
<TH>Attributes</TH>
<TH>Mode</TH>
</TR>
Summary of Contents for COLDFUSION 4.5-DEVELOPING WEB
Page 1: ...Allaire Corporation Developing Web Applications with ColdFusion ColdFusion 4 5...
Page 14: ...xiv Developing Web Applications with ColdFusion...
Page 26: ...xxvi Developing Web Applications with ColdFusion...
Page 34: ...8 Developing Web Applications with ColdFusion...
Page 70: ...44 Developing Web Applications with ColdFusion...
Page 84: ...58 Developing Web Applications with ColdFusion...
Page 114: ...88 Developing Web Applications with ColdFusion...
Page 148: ...122 Developing Web Applications with ColdFusion...
Page 174: ...148 Developing Web Applications with ColdFusion...
Page 208: ...182 Developing Web Applications with ColdFusion...
Page 244: ...218 Developing Web Applications with ColdFusion...
Page 274: ...248 Developing Web Applications with ColdFusion...
Page 288: ...262 Developing Web Applications with ColdFusion...
Page 300: ...274 Developing Web Applications with ColdFusion...
Page 350: ...324 Developing Web Applications with ColdFusion...
Page 362: ...336 Developing Web Applications with ColdFusion...