7
votes
3answers
621 views

How can a log program continue to log to a deleted file?

From the Unix Power Tools, 3rd Edition: Instead of Removing a File, Empty It section: If an active process has the file open (not uncommon for log files), removing the file and creating a new ...
5
votes
2answers
393 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, ...
2
votes
1answer
139 views

Max Open Files, clarification needed

On my machine, ulimit -n returns 2560 Given that -n returns The maximum number of open file descriptors. Does it mean that system won't allow more then 2560 open files to be out there at any ...
9
votes
4answers
3k 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 ...
11
votes
2answers
2k 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 | ...
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 ...
4
votes
2answers
1k views

What is the referent of a file descriptor?

My understanding is that a file descriptor is an integer which is a key in the kernel's per-process mapping to objects such as open()ed files, pipes, sockets, etc. Is there a proper, short, and ...