Unix recognizes 7 major filetypes. The file's type is stored in it's inode.
When a file is accessed, the Unix system uses the file's type to determine how or if the file may be accessed in the manor requested.
Regular file
mkfifo listpipe1 mkfifo listpipe2 ls > listpipe1& bash cat < listpipe1 ... output from whatever is being fed in from the ls > cd bin ls > ../listpipe2& exit # back in initial shell. cat < listpipe2& ... should be the contents of the bin directory |
Sockets are the final filetype. Much more advanced version of named-pipe. Used to communicate between processes on a system. Can be bi-directional. Supports packet or datagram style communication. Implemented in code, such as C. Usually consist of a 'server' program that constantly listens for 'client' requests to connect to it. And any number 'clients' may talk with a 'server'. Implimentation similar to networking, except rather than an IP# or network Mac# the named socket 'file' is the interface between clients and server.