How to see the number of files, sockets, pipes etc one process opens?

Discussion in 'Java' started by yuanyun.ken, Nov 4, 2008.

  1. yuanyun.ken

    yuanyun.ken Guest

    I need see the number of files, sockets, or pipes etc our process
    opens,
    I know lsof can do this, but unfortunately, customer's machines don't
    have this command, and it is impossible to install it on cutomer's
    machine.

    Iis there any linux alternative of lsof?
    Or can java directly implement this function?

    any help is greatly appreciated. Thanks in advance.
     
    yuanyun.ken, Nov 4, 2008
    #1
    1. Advertising

  2. yuanyun.ken

    Arne Vajhøj Guest

    Re: How to see the number of files, sockets, pipes etc one processopens?

    yuanyun.ken wrote:
    > I need see the number of files, sockets, or pipes etc our process
    > opens,
    > I know lsof can do this, but unfortunately, customer's machines don't
    > have this command, and it is impossible to install it on cutomer's
    > machine.
    >
    > Iis there any linux alternative of lsof?
    > Or can java directly implement this function?


    This is extremely platform specific. Java can not do it.

    Arne
     
    Arne Vajhøj, Nov 4, 2008
    #2
    1. Advertising

  3. Re: How to see the number of files, sockets, pipes etc one processopens?

    On Tue, 04 Nov 2008 08:29:34 -0800, yuanyun.ken wrote:

    > I need see the number of files, sockets, or pipes etc our process opens,
    > I know lsof can do this, but unfortunately, customer's machines don't
    > have this command, and it is impossible to install it on cutomer's
    > machine.
    >
    > Iis there any linux alternative of lsof? Or can java directly implement
    > this function?
    >
    > any help is greatly appreciated. Thanks in advance.


    ls -l /proc/*/fd

    You could probably write something in java, but there may be no need.
     
    Dan Stromberg, Nov 4, 2008
    #3
  4. yuanyun.ken

    Tom Anderson Guest

    Re: How to see the number of files, sockets, pipes etc one processopens?

    On Tue, 4 Nov 2008, yuanyun.ken wrote:

    > I need see the number of files, sockets, or pipes etc our process opens,
    > I know lsof can do this, but unfortunately, customer's machines don't
    > have this command, and it is impossible to install it on cutomer's
    > machine.
    >
    > Iis there any linux alternative of lsof?


    netstat will do it for network IO. I don't know a way to do files.

    > Or can java directly implement this function?


    Not without JNI, and if you can do JNI, you can just install lsof.

    I'd ask this question on a linux newsgroup.

    tom

    --
    All London roads are part of MY London Cycle Network. I'd like to see
    some of them removed from the London Motor Network! -- Ben Jefferys
     
    Tom Anderson, Nov 5, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marilyn Davis

    sockets and pipes and bad results

    Marilyn Davis, Sep 25, 2004, in forum: Python
    Replies:
    0
    Views:
    367
    Marilyn Davis
    Sep 25, 2004
  2. Kevin Walzer

    Re: PIL (etc etc etc) on OS X

    Kevin Walzer, Aug 1, 2008, in forum: Python
    Replies:
    4
    Views:
    418
    Fredrik Lundh
    Aug 13, 2008
  3. Wes Gamble
    Replies:
    1
    Views:
    167
    Gerardo Santana Gómez Garrido
    Apr 5, 2006
  4. Palaniappan

    Nameed pipes Vs sockets

    Palaniappan, Jun 11, 2004, in forum: Perl Misc
    Replies:
    1
    Views:
    136
    Ben Morrow
    Jun 11, 2004
  5. Olive
    Replies:
    1
    Views:
    113
    Ulrich Eckhardt
    Aug 6, 2013
Loading...

Share This Page