Re: Help in finding a file needed
- From: real-address-in-sig@xxxxxxxxxxxxxxx (Rowland McDonnell)
- Date: Tue, 5 Feb 2008 19:36:35 +0000
Chris Ridd <chrisridd@xxxxxxx> wrote:
(Rowland McDonnell) said:
It's like this. I've got a file on disc called:
mdwtab.pdf
It's a TeX-related file.
I'd like to find where it is on disc. I've got the file open using:
texdoc mdwtab
The lsof program will tell you this information, as it asks the kernel
and the kernel absolutely knows what programs have what files and
network connections open.
Righto.
With a file "mysterious.pdf" open in Preview - I don't have texdoc -
just grep for the filename in lsof's output. (The ^COMMAND stuff is to
match the column headers on the first line of output.)
Yur.
^ for `start of line', | for `or', yes?
lsof | egrep '^COMMAND|mysterious.pdf'
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Preview 41412 cjr txt REG 14,2 574303 9029878
/path/to/mysterious.pdf
Voila. Interestingly, you get the same output if you rm the file before
running lsof, but renaming the open file instead will show the new
name. I guess the filename printed is the last valid one.
Aha!
What I see is this:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
TeXShop 216 rowland txt VREG
stat(/private/tmp/TeXShop_Output/mdwtab.pdf): No such file or directory
Which is a pretty clear explanation of the state of things - if not the
reason for that state.
Rowland.
--
Remove the animal for email address: rowland.mcdonnell@xxxxxxxxxxxxxxx
Sorry - the spam got to me
http://www.mag-uk.org http://www.bmf.co.uk
UK biker? Join MAG and the BMF and stop the Eurocrats banning biking
.
- Follow-Ups:
- Re: Help in finding a file needed
- From: Chris Ridd
- Re: Help in finding a file needed
- References:
- Help in finding a file needed
- From: Rowland McDonnell
- Re: Help in finding a file needed
- From: Chris Ridd
- Help in finding a file needed
- Prev by Date: Re: Disk troubleshooter?
- Next by Date: Re: Help in finding a file needed
- Previous by thread: Re: Help in finding a file needed
- Next by thread: Re: Help in finding a file needed
- Index(es):
Relevant Pages
|