Description

Determines whether on-disk or in-memory directory exists.

Returns

Yes, if the specified directory exists; No, otherwise.

Category

System functions

Function syntax

DirectoryExists(path)

See also

DirectoryCreateDirectoryDeleteDirectoryListDirectoryRename

Parameters

Parameter

Description

path

An absolute on-disk or in-memory path. Alternatively, you can specify IP address as in the following example: DirectoryExists("//12.3.123.123/c_drive/test");

Example

<cfscript>
theDir=GetDirectoryFromPath(GetCurrentTemplatePath()); 
theFile=theDir & "sheets/Books_AddColumn.xlsx";
path = directoryExists(theFile);
writeoutput("Does the path exists" & "<br>" &  path);
</cfscript>

Output

Does the path exist: 
NO

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy