Since DirectoryExists returns a true/false, you don't need the IS "No"
part of the statement. Also, DirectoryExists expects you to pass it a
variable, so you don't need the quotes and pound signs around
variables.dirpath:
<cfif NOT DirectoryExists(variables.dirpath)>
<cfdirectory action="CREATE" directory="#variables.dirpath#">
</cfif>
HTH,
Carl
On 12/6/2011 1:56 PM, Shannon Rhodes wrote:
> This appears to happen randomly, making it difficult to replicate. Code will
> error that looks like this:
>
> <cfif DirectoryExists("#variables.dirpath#") IS "No"><cfdirectory
> action="CREATE" directory="#variables.dirpath#"></cfif>
>
> The error looks like this:
>
> The specified directory attribute value
> \\blah\AppDev\ParisDocs\blah\docs\
> could not be created
> The most likely cause of this error is that (above) already exists on your
> file system. The exception occurred during a cfdirectory action = 'CREATE'.
>
> The directory definitely exists and most of the time the code works. What
> can I look at to discover why DirectoryExists would return No when it should
> be yes?
>
> Thanks in advance!
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348988
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm