Opens a file
fileOpen(filePath [, mode [, charset] [, seekable]])
→ returns any
read
read
readBinary
write
append
utf-8
iso-8859-1
windows-1252
us-ascii
shift_jis
iso-2022-jp
euc-jp
euc-kr
big5
euc-cn
utf-16
false
fileSeek
function
// Open File
var fileObject = fileOpen("/path/to/file.txt");
// Perform Actions
try
{
// Read Line
writeOutput(fileReadLine(fileObject));
}
// Error Handling
catch(any ex)
{
// Report Exception
writeDump(ex);
}
// Always Close
finally
{
// Close File
fileClose(fileObject);
}
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.