Adobe COLDFUSION 9 Manual page 1256

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using External Resources
Appending a text file
You can use the cffile tag to append additional text to the end of a text file; for example, when you create log files.
Append a text file
Open the writetextfileaction.cfm file.
1
Change the value for the
2
<html>
<head>
<title>Append a Text File</title>
</head>
<body>
<cffile action="append"
file="C:\inetpub\wwwroot\mine\message.txt"
output="Appended By: #Form.Name#">
</body>
</html>
Save the file as writetextfileaction.cfm in the myapps directory under your web_root.
3
View the file in the browser, enter values, and submit the form.
4
The appended information displays at the end of the text file.
Using cfdirectory
Use the cfdirectory tag to return file information from a specified directory and to create, delete, and rename
directories. When listing directory contents or deleting a directory, you can optionally use the
access or delete all subdirectories.
As with the
tag, you can disable
cffile
syntax of this tag, see the CFML Reference.
Returning file information
When you use the
action="list"
attribute. The
attribute is required when you use the
name
result columns that you can reference in a
Directory entry name.
name
Directory containing the entry.
directory
Directory entry size.
size
File type: File or Dir.
type
Date an entry was last modified.
dateLastModified
(Windows only) File attributes, if applicable.
attributes
(UNIX only) The octal value representing the permissions setting for the specified directory.
mode
Note: ColdFusion supports the ReadOnly and Hidden values for the
Depending on whether your server is on a UNIX system or a Windows system, either the Attributes column or the
Mode column is empty. Also, you can specify a filename in the
The following procedure describes how to create a ColdFusion page in which to view directory information.
attribute from
action
write
processing in the ColdFusion Administrator. For details on the
cfdirectory
attribute setting, the
cfdirectory
tag, using the value specified in the
cfoutput
Last updated 8/5/2010
to
so that the file appears as follows:
append
returns a query object as specified in the
attribute setting. This query object contains
action="list"
attribute for
attributes
attribute to get information on a single file.
filter
attribute to
recurse
name
attribute:
name
sorting.
cfdirectory
1251

Advertisement

Table of Contents
loading

Table of Contents