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

Y

yuanyun.ken

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.
 
A

Arne Vajhøj

yuanyun.ken said:
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
 
D

Dan Stromberg

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.
 
T

Tom Anderson

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,052
Latest member
KetoBeez

Latest Threads

Top