Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

File Open by Process

by shaikh741 (Novice)
on Nov 22, 2011 at 20:13 UTC ( [id://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 (Patriarch) 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 (Archbishop) 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?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://939533]
Approved by Eliya
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-16 07:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found