Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

File Open by Process

by shaikh741 (Novice)
on Nov 22, 2011 at 20:13 UTC ( #939533=perlquestion: print w/replies, xml ) Need Help??
shaikh741 has asked for the wisdom of the Perl Monks concerning the following question:

I am looking for a way to capture all the file opens that occur from a process (external command, like system call, etc) called by a Perl script. Any help would be appreciated.

Replies are listed 'Best First'.
Re: File Open by Process
by Eliya (Vicar) on Nov 22, 2011 at 20:21 UTC

    Which platform are you on?  On Linux/Unix you could use strace/truss/tusc...  On Windows, there's Process Monitor (from Sysinternals).

Re: File Open by Process
by BrowserUk (Pope) on Nov 22, 2011 at 20:49 UTC

    See StraceNT.

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      I am on Linux and trying to create a script which calls an external program which in turn calls compilers and linkers to build C/C++ applications. I would like to capture all the file opens from the the external program to find out exactly which files were opened with complete path to them.
Re: File Open by Process
by eyepopslikeamosquito (Chancellor) on Nov 23, 2011 at 06:20 UTC

    Be aware that, in addition to strace/truss, there is another Unix tool might prove useful when tracking open files, namely lsof.

      thank you monks!!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://939533]
Approved by Eliya
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2017-11-19 13:30 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (281 votes). Check out past polls.