You can find the CFFiddle demo of this function and other file functions as part of a project that is shared with you.
Click the button below to launch CFFiddle.
To copy the project in your workspace in CFFiddle, follow the steps below:
Determines whether ColdFusion has reached the end of an on-disk or in-memory file while reading it.
Yes, if the end of the file has been reached; No, otherwise.
System functions, Decision functions
FileIsEOF(fileObj) |
FileClose, FileOpen, FileRead, FileReadLine
ColdFusion 8: Added this function.
Parameter |
Description |
|---|---|
fileobj |
The file object. |
The following example reads a file until it reaches the end of the file:
<cfscript>
theDir=GetDirectoryFromPath(GetCurrentTemplatePath())
theFolder=theDir&"Sample files/Test.txt"
myfile = FileOpen(theFolder, "read");
while(!FileIsEOF(myfile))
{
x = FileReadLine(myfile);
WriteOutput("#x# ");
}
FileClose(myfile);
</cfscript>
Output
Hi! This is the content inside the file "Test.txt".
Sign in to your account