File Browser errs spuriously on directory deletion

DH
Posted By
Dan_Heller
Jun 21, 2004
Views
846
Replies
0
Status
Closed
If you delete or move all the files in a directory using the file browser, and then go up a directory, you may or may not be able to delete that directory. I can’t reliably find a way to reproduce the problem–sometimes it works, sometimes it doesn’t–but it seems to happen more often than not when moving around the directory tree a lot. That is, previewing images in directories, moving images from one place to the next, and then trying to prune the empty directories later.

The error is cryptic "cannot delete directory," a problem that also seems to be shared by Windows Explorer if you try to use that to delete the directory as well. (Again, the same cryptic error message.) It’s somewhat driving me nuts, hence this message.

This is error is only caused by the circumstance that some other process has an open handle to the inode associated with that directory. the operating system won’t allow any process (application) to delete an object that is being held open by another process. Only when all handles are closed will the OS allow the object to be actually removed. Otherwise, the message appears. What’s going on here is that PS CS is erroneously holding onto an open object on that directory; failing to close it and release the handle. Another symptom of this behavior is that PS will eventually run out of file handles it can have open at any one time, causing the program to crash. This has happened to me several times in the "spring cleaning" process described above: if you move around a lot between directories, moving things around, deleting them, etc., you will eventually force PS to hit its file handle limit, and then crash. Since PS is unpredictable and spurious about how it may erroneously fail to "release" a file handle, this problem cannot be easily or reliably reproduced.

The workaround is to terminate PS (which causes the handle to be released implicitly by the OS upon termination of a process), at which point you can remove the directory using Windows Explorer (or any other file-browsing UI).

Must-have mockup pack for every graphic designer 🔥🔥🔥

Easy-to-use drag-n-drop Photoshop scene creator with more than 2800 items.

Related Discussion Topics

Nice and short text about related topics in discussion sections