Gentoo Archives: gentoo-user

From: Darren Kirby <bulliver@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] oder of files opened by a process
Date: Fri, 01 Oct 2010 17:01:23
Message-Id: AANLkTi=TbVSLapAnVisVw6ydihWbB0QqE=6g__r==Btc@mail.gmail.com
In Reply to: Re: [gentoo-user] oder of files opened by a process by Dale
1 On Fri, Oct 1, 2010 at 10:29 AM, Dale <rdalek1967@×××××.com> wrote:
2 > Al wrote:
3 >>
4 >> Hello,
5 >>
6 >> I want to find out by which file and line the */temp/environment
7 >> script is run or sourced.
8 >>
9 >> As a am always interested in a general way to solve something, I ask
10 >> if there is a tool, that displays me the order in which  files are
11 >> read by a process.
12 >>
13 >> Al
14 >>
15 >>
16 >
17 > I'm not sure but you may want to check into strace.  It may be what you are
18 > looking for.
19 >
20
21 strace may do the job in a pinch, but there is almost certainly
22 something better suited to the task...however I don't know what it is.
23 You may want to use like this:
24
25 $ strace YourScript 2>&1 | grep open
26
27 which will run YourScript and print all open() system calls to the
28 console. You will have to sort through many unrelated calls (such as
29 reading shared library calls) but it will show the order in which your
30 script is opening external files. Presumably you could key in on the
31 relevant files using more grep calls and pipes...
32
33 >
34 > Dale
35 >
36 > :-)  :-)
37 >
38 >
39
40
41 D
42 --
43 --
44 Support the mob or mysteriously disappear...
45 I'm on flickr: http://www.flickr.com/photos/badcomputer/

Replies

Subject Author
Re: [gentoo-user] oder of files opened by a process David Relson <relson@×××××××××××××.com>