Never can say goodbye

Back in January, I wrote this little script for determining which process is preventing me from emptying my Trash. You know the problem: you try to empty your Trash and you get an error message telling you that file xxx can’t be deleted because it’s in use. My script, called trash-users, invokes the system-supplied lsof command to tell you which process won’t let the file go.

I’ve used trash-users a handful of times in the past few months, and in every case, the problem was Mail not allowing me to delete a file that I had attached to an email. These were files I needed to forward along to someone but didn’t need to retain. For some reason, even well after the messages were sent, Mail wouldn’t release the file for deletion.

Not every attachment I throw in the Trash gets hung up this way, so it’s not an easily reproducible bug, but I’ve submitted it to Apple anyway.

Alternate titles considered for this post were “You Keep Me Hanging On” and “Please Mr. Postman.” Mail bugs must have an affinity for Motown.

Update 4/13/10
Apple has classified this bug as a duplicate and is supposedly investigating/working on it. Based on the original bug number, I would guess this was first reported back in 2008 or so. Doesn’t seem to be a high priority.