FileCanWrite(filename)
Last updated November 14, 2002
Version: 1 | Requires: ColdFusion MX | Library: FileSysLib
Description:
Checks to see if a file can be written to. It uses the standard Java File object, which makes it very fast under Coldfusion MX.
Return Values:
Returns a boolean.
Example:
<cfoutput>
Can write to: #FileCanWrite(filename)#<br>
</cfoutput>
Parameters:
| Name | Description | Required |
|---|---|---|
| filename | The name of the file. | Yes |
Full UDF Source:
<cfscript>
/**
* Checks to see if a file can be written to.
*
* @param filename The name of the file. (Required)
* @return Returns a boolean.
* @author Jesse Houwing (j.houwing@student.utwente.nl)
* @version 1, November 14, 2002
*/
function FileCanWrite(filename){
var daFile = createObject("java", "java.io.File");
daFile.init(JavaCast("string", filename));
return daFile.canWrite();
}
</cfscript>
Search CFLib.org
Latest Additions
Jose Diaz-Salcedo added
cfRssFeed
3 day(s) ago
Raymond Compton added
structBlend
23 day(s) ago
Duncan added
IsZIPUK
23 day(s) ago
Todd Sharp added
getTagContentAll
29 day(s) ago
Gerald Guido added
ListReturnDuplicat...
1 month(s) ago