Differences between revisions 1 and 2
Revision 1 as of 2013-11-22 03:30:34
Size: 1068
Editor: 41
Comment:
Revision 2 as of 2013-11-22 03:35:03
Size: 1103
Editor: 41
Comment:
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
Those pseudo files appear to by symlinks to the original filename by which the file descriptor was opened, but otherwise accessing the file accesses the underlying original file, even if the target of the symlink has been deleted or replaced. The permissions on the link indicate whether the file descriptor is open for reading, writing or both. Those pseudo files appear to be symbolic links to the original filename by which the file descriptor was opened, but otherwise accessing the filename continues to access the underlying original file, even if the referrent of the symbolic link has been deleted or replaced. The permissions on the link indicate whether the file descriptor is open for reading, writing or both.
Line 7: Line 7:
In other operating systems, `/dev/fd/$FD` may simlarly appear to be a symlink, or it may be represented as a block or character device, with no particular association with the original filename. In other operating systems, `/dev/fd/$FD` may simlarly appear to be a symlink, or it may be represented as a (block or character) device, and has no particular association with the original filename.

Different operating systems use different mechanisms to make a process's internal state visible in the file hierarchy. In particular, this applies to making each process's file-descriptors accessible.

In most Linux distributions, /dev/fd is a symbolic link to /proc/self/fd, where /proc is a special file-system synthesized by the kernel. Within that, self is a symlink to each process's own process ID, and /proc/$PID/fd/$FD is a pseudo file representing the open file-descriptor $FD for the process $PID.

Those pseudo files appear to be symbolic links to the original filename by which the file descriptor was opened, but otherwise accessing the filename continues to access the underlying original file, even if the referrent of the symbolic link has been deleted or replaced. The permissions on the link indicate whether the file descriptor is open for reading, writing or both.

In other operating systems, /dev/fd/$FD may simlarly appear to be a symlink, or it may be represented as a (block or character) device, and has no particular association with the original filename.

NamedFileDescriptor (last edited 2013-11-22 03:35:03 by 41)