Matej Kosik:
> 
> I am trying to figure out the meaning of:
> 
>       /proc/$PID/fd/*
> 
> files.

These files represent the open files of a process. On recent systems you
can even see the associated "real" files, if any:

# ls -l /proc/6373/fd
total 0
lr-x------ 1 root root 64 Feb 19 10:25 0 -> /dev/null
l-wx------ 1 root root 64 Feb 19 10:25 1 -> /dev/null
l-wx------ 1 root root 64 Feb 19 10:25 2 -> /var/log/apache2/error.log
lrwx------ 1 root root 64 Feb 19 10:25 3 -> socket:[8270]
lrwx------ 1 root root 64 Feb 19 10:25 4 -> socket:[201752]
lr-x------ 1 root root 64 Feb 19 10:25 5 -> pipe:[200346]
l-wx------ 1 root root 64 Feb 19 10:25 6 -> pipe:[200346]
l-wx------ 1 root root 64 Feb 19 10:25 7 -> 
/var/log/apache2/other_vhosts_access.log
l-wx------ 1 root root 64 Feb 19 10:25 8 -> /var/log/apache2/access.log

This is shown using kernel 3.2 from wheezy.

File descriptor 0 should usually be stdin. Your example probably did not
work as expected because stdin of your program was some kind of terminal
(dev/pts/<n> or /dev/tty<n>).

J.
-- 
I frequently find myself at the top of the stairs with absolutely
nothing happening in my brain.
[Agree]   [Disagree]
                 <http://www.slowlydownward.com/NODATA/data_enter2.html>

Attachment: signature.asc
Description: Digital signature

Reply via email to