Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.5: Find out which program/process is locking a file' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: Find out which program/process is locking a file
Authored by: SOX on Nov 23, '09 08:44:39AM

Here's the workflow that I use

1) ASK FINDER FOR ITEMS
Start at /Volumes
Type: Files and Folders (Allow multiple selection)

2) RUN SHELL SCRIPT
shell: /usr/bin/perl
pass input as arguments

for $f (@ARGV) { $r = quotemeta $f; $c = `basename $r`; print `lsof +fg | grep -v " EVO " | grep "$r"`};

3) ASK FOR TEXT
text: "The Culprits"
default text: "Nothing Found"
require an answer

When you run this, it opens /volumes and lets you pick the disk you cannot eject. then it tells you which apps are locking it.



[ Reply to This | # ]
10.5: Find out which program/process is locking a file
Authored by: SOX on Nov 23, '09 08:46:34AM

By the way this workflow should work better than the original hint because it removes a bunch of false positive hits. LSOF will report apps that have files open in a non-binding sort of way. the perl script in the above automater will strip those out.



[ Reply to This | # ]