Unix file types
Regular file Main article: Computer file
-rw-r-—r-- ... /etc/passwd
Directory Main article: File directory
drwxr-xr-x 26 root root 4096 Sep 22 09:29 /
Symbolic link Main article: Symbolic link
lrwxrwxrwx ... termcap -> /usr/share/misc/termcap
Named pipe Main article: Named pipe
prw-rw---- ... mypipe
Socket Main article: Unix domain socket
A socket is a special file used for inter-process communication.
These allow communication between two processes.
In addition to sending data, processes can send file descriptors
across a Unix domain socket connection
using the
sendmsg()andrecvmsg()system calls.Unlike named pipes sockets are fully duplex-capable.
srwxrwxrwx ... /tmp/.X11-unix/X0
Device file Main article: Device file
Device files are used to apply access rights and to direct operations on the files to the appropriate device drivers.
Unix makes a distinction between character devices and block devices. The distinction is roughly as follows:
- character devices provide only a serial stream of input or output;
- block devices are randomly accessible;
crw------- ... /dev/null brw-rw---- ... /dev/sda
Door Main article: Doors (computing)
A door is a special file for inter-process communication between a client and server, currently implemented in the Sun Solaris operating system only.
Dr--r--r-- ... name_service_door
from:http://en.wikipedia.org/wiki/Unix_file_type

浙公网安备 33010602011771号