CFLib.org – Common Function Library Project

FileCanRead([filename])

Last updated November 14, 2002

author

Jesse Houwing

Version: 1 | Requires: CF6 | Library: FileSysLib

Description:
Checks if a file can be read. It uses the standard Java File object, which makes it very fast under Coldfusion MX

Return Values:
Returns a boolean.

Example:

<cfset filename="c:\autoexec.bat">
<cfoutput>
	Length: #FileCanRead(filename)#<br>
</cfoutput>

Parameters:

Name Description Required
filename The file to check. No

Full UDF Source:

/**
 * Checks if a file can be read.
 * 
 * @param filename 	 The file to check. (Optional)
 * @return Returns a boolean. 
 * @author Jesse Houwing (j.houwing@student.utwente.nl) 
 * @version 1, November 14, 2002 
 */
function FileCanRead(filename){
	var daFile = createObject("java", "java.io.File");
	daFile.init(JavaCast("string", filename));
	return daFile.canRead();
}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson