I do not have Adobe Design CSx .... but I've tested this with numerous other programs, and have been unable to replicate the issue.
If it were a Finder problem, would it not happen to all applications?
Not necessarily, Finder keeps the file it previews open, and Indesign notices that the file to be overwritten is in use by some other process (in this case Finder). Some applications might just overwrite the file and see what happens, in most cases it will succeed. The developers of Indesign obviously chose to check if the file is in use before overwriting, which by a glitch in Finder is positive because it leaves the file open.
Indesign behaves differently when selecting or deselecting the file in Finder, which Indesign is unaware of, other than that Finder is doing something with the file so Indesign will overwrite the file or not. I already demonstrated that keeping the file to be overwritten open will simulate the problem. And Activity Monitor confirms that the file is open by Finder.
!! Found the cause of the problem !!
As Photoshop is experiencing the same problem overwriting files in PDF format, it drove my attention to Quicklook. The preview (or better thumbnail) in Finder is generated by QuickLook, a daemon which handles thumbnails and previews. Some are pre-installed by OS X, as is the PDF handler installed in /System/Library/QuickLook/PDF.qlgenerator
Disabling this plug-in by moving it to another directory eliminates the problem altogether. Downside is that PDFs can no longer be previewed with this system plug-in, or some developer at Apple should review this qlgenerator.
I see over at this thread: http://forums.adobe.com/message/2479648
An Adobe employee said:
Adobe has done what we can (and we're still trying to find other ways around it, like trying again after half a second) - but the files are being locked by something OUTSIDE our control.
We've notified Apple about it, and they have made several fixes over the years - but somehow the problem keeps recurring in their software.
No, this does not come up just in Photoshop. It happens in any application that actually checks for errors when saving the file. But there are many applications that don't check for such errors.
Correct, this problem should not exist. But all we can really do is tell the user when it does occur.
I've been having this problem for a bit and couldn't figure it out, it was driving me a little crazy.
Like has been said, anytime I export a PDF from InDesign that I wanted to copy over a previous PDF, I would get the "file in use" or "you don't have permission" error.
I think I fixed it, try this and see if it helps.
When exporting from InDesign I had the option selected to "View PDF after Exporting"
So when it completed the export, the PDF would auto open in Preview.
Then when I went back to re-export, it seemed that even if I had closed Preview, InDesign or OSX felt like the file was "still in use"
If I turn off that "View PDF after Exporting" option then I seem to be able to save over the original as much as I'd like.
Just started having thei issue with InDesign and CS5 after upgrading to Mountain Lion.
Found and app that tells you which program is locking the file in question (http://www.hamsoftengineering.com/products/wkm/wkm.html) and the result is definately the finder, then it shows the process ID, then it says cookied.
Does "cookied" shed any light on this.