Re: DirectoryExists sometimes returning incorrect value

2011-12-07 Thread Claude Schnéegans
I'm having a similar problem, although in a completely different context, since I migrate my development server from XP to Windows 7. I'm still using ColdFusion Studio, and starting with W7, when I search for some string in files and it finds one say in C:\inetsrv\wwwroot\myProjet\myFile.cfm, i

Re: DirectoryExists sometimes returning incorrect value

2011-12-07 Thread Judah McAuley
A path that starts with \\ is a UNC path. UNC paths can be funky as they are not necessarily real physical paths on your server but rather logical paths on a mapped device, like SAN. UNC paths should work, in general. Sometimes permissions will be problematic with UNC paths but that shouldn't cau

Re: DirectoryExists sometimes returning incorrect value

2011-12-07 Thread Cameron Childress
Only other thing that immediately comes to mind is that it looks like that may be a network drive so perhaps something's going on on that network device or the network itself. If the directory should pretty much always exist, I'd run that code in your onApplicationStart() or find another way to o

Re: DirectoryExists sometimes returning incorrect value

2011-12-07 Thread Carl Von Stetten
It may be more than a style preference. I'm not sure that "No" as a string value is always equivalent to a true/false boolean value. My suggestion was intended to help identify if that might actually be your issue. I've experienced intermittent issues with FileExists and trying to delete fi

Re: DirectoryExists sometimes returning incorrect value

2011-12-07 Thread Shannon Rhodes
I honestly don't know; it's coming from the global variable for all of our applications. I guess I always assumed it had to do with mappings or something, since we can't have a relative path here. I can definitely strip it out and see if that solves the problem. > >>The specified directory a

Re: DirectoryExists sometimes returning incorrect value

2011-12-07 Thread Shannon Rhodes
I understand and agree with your style preferences, but neither complaint with legacy code would cause issues. >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

Re: DirectoryExists sometimes returning incorrect value

2011-12-07 Thread Shannon Rhodes
Very unlikely, the directory definitely exists, since it's our main repository for documents...we aren't creating it all the time, it's just a best practice that we're checking for existence. >Could this same code be run concurrently by two threads/users? One thread >could be int he process of

Re: DirectoryExists sometimes returning incorrect value

2011-12-07 Thread Cameron Childress
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)

Re: DirectoryExists sometimes returning incorrect value

2011-12-07 Thread Claude Schnéegans
>>The specified directory attribute value \\blah\AppDev\ParisDocs\blah\docs\ What is the double \\ for? Sometimes it is taken as equivalent as one single \, but some other time it may not. This could explain why DirectoryExists says it doesn't but it is found when being created. ~

Re: DirectoryExists sometimes returning incorrect value

2011-12-07 Thread Carl Von Stetten
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: HTH, Carl On 12/6/2011 1:56 PM, Shannon Rhodes wrote: > This appea

DirectoryExists sometimes returning incorrect value

2011-12-06 Thread Shannon Rhodes
This appears to happen randomly, making it difficult to replicate. Code will error that looks like this: 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 exis