The tag has no wiki summary.

learn more… | top users | synonyms

15
votes
2answers
7k views

/proc/PID/fd/X link number

In Linux, in /proc/PID/fd/X, the links for file descriptors that are pipes or sockets have a number, like: l-wx------ 1 user user 64 Mar 24 00:05 1 -> pipe:[6839] l-wx------ 1 user user 64 Mar 24 ...
5
votes
2answers
672 views

Portability of file descriptor links

I've always wondered this but never took the time to find out, so I'll do so now - how portable is the usage shown here of either /proc/$$/fd/$N or /dev/fd/$N? I understand POSIX guarantees /dev/null, ...
9
votes
4answers
4k views

How can same fd in different processes point to the same file?

Say I have process 1 and process 2. Both have a file descriptor corresponding to the integer 4. In each process however the file descriptor 4 points to a totally different file in the Open File Table ...
24
votes
1answer
22k views

ulimit: difference between hard and soft limits

What is the difference between hard and soft limits in ulimit? For number of open files, I have a soft limit of 1024 and a hard limit of 10240. It is possible to run programs opening more than 1024 ...
16
votes
3answers
25k views

Find and remove large files that are open but have been deleted

How does one find large files that have been deleted but are still open in an application? How can one remove such a file, even though a process has it open? The situation is that we are running a ...
5
votes
0answers
102 views

How can different file descriptors point to the same file in open file table? [duplicate]

Possible Duplicate: How can same fd in different processes point to the same file? I have a hard time grasping the two ideas of File Descriptor Table and Open File Table. Open File Table ...
22
votes
2answers
5k views

Who's got the other end of this unix socketpair?

I want to determine what process has the other end of a unix socket, that was created with socketpair(). I have a program parent which creates a socketpair(AF_UNIX, SOCK_STREAM, 0, fds), and fork()s. ...
20
votes
3answers
19k views

Why is number of open files limited in Linux?

Right now, I know that: Find open files limit per process: ulimit -n Count all opened files by all process: lsof | wc -l Get maximum open files count allowd: cat /proc/sys/fs/file-max My ...
15
votes
3answers
3k views

Monitor what is being sent to /dev/null?

Just for fun: Is there a way to monitor/capture/dump whatever is being written to /dev/null? On Debian, or FreeBSD, if it matters, any other OS specific solutions are also welcome.
12
votes
2answers
3k views

What happens when I close() a file descriptor?

I am trying to get the whole picture with file descriptors. Say I have process1 which initially has these file descriptors: _process1_ | | | 0 stdin | | 1 stdout | | 2 stderr | ...
13
votes
3answers
1k views

Where do open file handles go when they die?

What happens to the files that are deleted while they have a file handle open to them? I have been wondering this ever since I figured out I could delete a video file while it was playing in MPlayer ...
2
votes
1answer
52 views

Find out to which directory a process is writing?

This question is NOT a duplicate of this question Find out current working directory of a running process?, because the writing directory can be different from the working directory. For example, I ...
5
votes
2answers
4k views

How to find out which file is currently written by a process

My situation is that from time to time a specific process (in this case, it's Thunderbird) doesn't react to user input for a minute or so. I found out using iotop that during this time, it writes ...
3
votes
2answers
432 views

Capturing new output after deleting the output file

I'm runnig a java server on Debian with this command: java -jar myapp.jar [args] >> log.txt Once I gzipped the log file to send it and then I realized the original file was gone, leaving me ...