Returns YES if the directory specified in the argument exists; otherwise, returns NO.
DirectoryExists(absolute_path)
Parameter |
Description |
---|---|
absolute_path |
A absolute path |
<!--- This example shows the use of DirectoryExists ---> <html> <head> <title> DirectoryExists Example </title> </head> <body bgcolor = silver> <H3>DirectoryExists Example</H3> <cfset thisPath = ExpandPath("*.*")> <cfset thisDirectory = GetDirectoryFromPath(thisPath)> <cfset thisDirectory = Left(thisDirectory, Evaluate(Len(thisDirectory) - 1"))> <cfoutput> The current directory is: #GetDirectoryFromPath(thisPath)# <cfif IsDefined("FORM.yourDirectory")> <cfif FORM.yourDirectory is not ""> <cfset yourDirectory = FORM.yourDirectory> <cfif DirectoryExists(yourDirectory)> <P>Your directory exists. You entered a valid directory name, #yourdirectory#