Could this same code be run concurrently by two threads/users?  One thread
could be int he process of creating the Dir when another does it's
dirExists() check.  You may want to toss a named lock around it to make
sure only one process is messing with the directory at once.  I'd use
hash(dirpath) as the name of the lock to make it a clean unique URL with no
special characters..

-Cameron

On Tue, Dec 6, 2011 at 4:56 PM, Shannon Rhodes <shan...@rhodesedge.com>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:348992
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to