fbpx
Wikipedia

Everything is a file

Everything is a file is an idea that Unix, and its derivatives, handle input/output to and from resources such as documents, hard-drives, modems, keyboards, printers and even some inter-process and network communications as simple streams of bytes exposed through the filesystem name space.[1] Exceptions include shared memory, semaphores, datagram sockets, symbolic links, directories (which are read-only, and are not accessed as a byte-stream), processes and threads.

The advantage of this approach is that the same set of tools, utilities and APIs can be used on a wide range of resources and a number of file types. When a file is opened, a file descriptor is created, using the file path as an addressing system. The file descriptor is then a byte stream I/O interface on which file operations are performed. Additionally, file descriptors are also created for objects such as anonymous pipes and network sockets - and therefore a more accurate description of this feature is Everything is a file descriptor.[2][3]

Additionally, a range of pseudo and virtual filesystems exists which exposes information about processes and other system information in a hierarchical file-like structure. These are mounted into the single file hierarchy.

An example of this purely virtual filesystem is under /proc that exposes many system properties as files. All of these files, in the broader sense of the word, have standard Unix file attributes such as an owner and access permissions, and can be queried by the same classic Unix tools and filters. However, this is not universally considered a fast or portable approach. Some operating systems do not even mount /proc by default due to security or speed concerns.[4] It is, though, used heavily by both the widely installed BusyBox[5] on embedded systems and by procps, which is used on most Linux systems. In both cases it is used in implementations of process-related POSIX shell commands. It is similarly used on Android systems in the operating system's Toolbox program.[6]

See also

References

  1. ^ In UNIX Everything is a File January 10, 2015, at the Wayback Machine
  2. ^ "Linus Torvalds - 'everything is a file descriptor or a process'". Yarchive.net. Retrieved 2015-08-28.
  3. ^ "Ghosts of Unix Past". Lwn.net. Retrieved 2015-08-28.
  4. ^ "8. procfs: Gone But Not Forgotten". Freebsd.org. Retrieved 2015-08-28.
  5. ^ "busybox - BusyBox: The Swiss Army Knife of Embedded Linux". Git.busybox.net. Retrieved 2015-08-28.
  6. ^ "platform_system_core/ps.c at master · android/platform_system_core · GitHub". GitHub.com. 2015-03-09. Retrieved 2015-08-28.

everything, file, this, article, relies, excessively, references, primary, sources, please, improve, this, article, adding, secondary, tertiary, sources, find, sources, news, newspapers, books, scholar, jstor, august, 2015, learn, when, remove, this, template,. This article relies excessively on references to primary sources Please improve this article by adding secondary or tertiary sources Find sources Everything is a file news newspapers books scholar JSTOR August 2015 Learn how and when to remove this template message Everything is a file is an idea that Unix and its derivatives handle input output to and from resources such as documents hard drives modems keyboards printers and even some inter process and network communications as simple streams of bytes exposed through the filesystem name space 1 Exceptions include shared memory semaphores datagram sockets symbolic links directories which are read only and are not accessed as a byte stream processes and threads The advantage of this approach is that the same set of tools utilities and APIs can be used on a wide range of resources and a number of file types When a file is opened a file descriptor is created using the file path as an addressing system The file descriptor is then a byte stream I O interface on which file operations are performed Additionally file descriptors are also created for objects such as anonymous pipes and network sockets and therefore a more accurate description of this feature is Everything is a file descriptor 2 3 Additionally a range of pseudo and virtual filesystems exists which exposes information about processes and other system information in a hierarchical file like structure These are mounted into the single file hierarchy An example of this purely virtual filesystem is under proc that exposes many system properties as files All of these files in the broader sense of the word have standard Unix file attributes such as an owner and access permissions and can be queried by the same classic Unix tools and filters However this is not universally considered a fast or portable approach Some operating systems do not even mount proc by default due to security or speed concerns 4 It is though used heavily by both the widely installed BusyBox 5 on embedded systems and by procps which is used on most Linux systems In both cases it is used in implementations of process related POSIX shell commands It is similarly used on Android systems in the operating system s Toolbox program 6 See also Edit9P A network protocol developed for the Plan 9 distributed operating system Device file Synthetic file system Unix architectureReferences Edit In UNIX Everything is a File Archived January 10 2015 at the Wayback Machine Linus Torvalds everything is a file descriptor or a process Yarchive net Retrieved 2015 08 28 Ghosts of Unix Past Lwn net Retrieved 2015 08 28 8 procfs Gone But Not Forgotten Freebsd org Retrieved 2015 08 28 busybox BusyBox The Swiss Army Knife of Embedded Linux Git busybox net Retrieved 2015 08 28 platform system core ps c at master android platform system core GitHub GitHub com 2015 03 09 Retrieved 2015 08 28 Retrieved from https en wikipedia org w index php title Everything is a file amp oldid 1132192068, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.