1

on El Cap (I noticed this since upgrade to 10.11.3) Preview keeps accessing closed PDF files, which means I cannot empty the trash. In fact the problem exists even if Preview is not running. I open a file, close Preview and the file, trash it, try to empty the trash and I get 'the file is in use'. Just now:

:~$ lsof .Trash/tutorial-strata.pdf
COMMAND     PID      USER   FD   TYPE DEVICE SIZE/OFF      NODE NAME
Preview   62216 me  txt    REG    1,4   196236 109606954 .Trash/tutorial-strata.pdf
QuickLook 71216 me  txt    REG    1,4   196236 109606954 .Trash/tutorial-strata.pdf

(as you might notice Quicklook wanted some of the action despite the fact I did not activate a preview of the file). How can I stop this most annoying behaviour?

#

following GhostLyrics' suggestion I run:

:~$ ps -ef|grep Prev
  501  2411     1   0 12:00am ??         0:08.49 /Applications/Preview.app/Contents/MacOS/Preview -psn_0_28633933
  501  2412     1   0 12:00am ??         0:00.01 /Applications/Preview.app/Contents/XPCServices/com.apple.Preview.TrustedBookmarksService.xpc/Contents/MacOS/com.apple.Preview.TrustedBookmarksService
  501 16880 57035   0 12:36pm ttys000    0:00.00 grep Prev

so Preview is still running in the background despite the fact it is not open (according to the Dock):

The Dock showing Preview should not be running

Hence it looks like that preview is not actually closing properly for some reason or another....

0

2 Answers 2

1

I do not have a solution, but I can confirm that this definitely happens (10.11.3) and appears to be a regression. (I see reports of this from 2011, but it has never bitten me all these years, until fairly recently.) The OP is not hallucinating and his report is entirely accurate, and he is not confused about what he did.

Interestingly, I never had the file open in Preview. I was not running Preview! The file was created by Print-to-PDF from Safari onto my Desktop. The only thing I did with it there was to decide I didn't actually want that file, and cmd-Del it to the Trash. Then when I went to empty the trash I got the "in use" error dialog.

I have been having this same problem for just the last few months. I used lsof and the Activity Monitor to see what was going on. (It was a QuickLook satellite process.)

My random theory is that QuickLook is aggressively caching the content of new files, so that they can come up super-fast, should I happen to want it. Then a bug happens and it forgets to free that (handle leak). Or something like that. The file stays "in use" until I log out or kill the offending process.

Maybe Apple will fix this bug. Until then: Yeah, it's a for-real problem.

1

Are you sure that Preview is indeed not running as opposed to not visible? (CMD+W vs. CMD+Q)

As for an image explaining what I mean, refer to this: http://geek-and-poke.com/geekandpoke/2013/8/24/the-one-and-only-difference-between-os-x-and-windows


Update:

example output for non-running Preview:

ps -ef|grep Prev
502 46649 46541   0  8:58PM ttys000    0:00.00 grep Prev

example for running Preview:

ps -ef|grep Prev
502 46655     1   0  8:58PM ??         0:01.16 /Applications/Preview.app/Contents/MacOS/Preview -psn_0_11016833
502 46656     1   0  8:58PM ??         0:00.01 /Applications/Preview.app/Contents/XPCServices/com.apple.Preview.TrustedBookmarksService.xpc/Contents/MacOS/com.apple.Preview.TrustedBookmarksService
502 46661 46541   0  8:58PM ttys000    0:00.00 grep Prev
2
  • Pretty sure Preview is not running. Commented Jan 30, 2016 at 19:15
  • @user1256923 I've updated the post and added a command to help you make sure it isn't or is. Commented Jan 30, 2016 at 20:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .