"Everything is a file" describes one of the defining features of Unix, and its derivatives — that a wide range of input/output resources such as documents, directories, hard-drives, modems, keyboards, printers and even some inter-process and network communications are simple streams of bytes exposed through the filesystem name space.[1]

The advantage of this approach is that the same set of tools, utilities and APIs can be used on a wide range of resources. There are a number of file types. When a file is opened a file descriptor is created. The file path becoming the addressing system and the file descriptor being the byte stream I/O interface. But file descriptors are also created for things like anonymous pipes and network sockets via different methods. So it is more accurate to say "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" 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]

Unix's successor Plan 9 took this concept into distributed computing with the 9P protocol.

https://en.wikipedia.org/wiki/Everything_is_a_file

最新文章

  1. cmd导入导出
  2. jquery 模拟 alert 手机,pc,平板 3合一
  3. shell判断文件或者文件夹是否存在
  4. 8 个最棒的 .NET 开发相关工具
  5. SOA架构改造简单记录
  6. md5加密过程
  7. sparse coding稀疏表达入门
  8. java nio知识点总结
  9. [Leetcode][Python]44:Wildcard Matching
  10. 在VM12中安装 RedHat RHEL7.2  系统的详细步骤
  11. python 打包下载 zipfile & tarfile
  12. 哪些领域适合开发微信小程序
  13. 〖Java〗Eclispe安装和使用viplugin
  14. 从Adobe调查问卷看原型设计工具大战
  15. JavaScript 之 对象和数组
  16. django开发项目的部署nginx
  17. windows下,python3安装django和mysql驱动
  18. .NET实现CORS跨域
  19. Python学习之property
  20. 动态数组第k小,Poj(1442)

热门文章

  1. 【codeforces 527D】Clique Problem
  2. ACM的你伤不起
  3. K - Count the string kmp_Next数组应用
  4. Bootstrap:解决Bootstrap下拉框需要双击才能打开的问题
  5. jQuery Validate Ajax 验证
  6. java读取中文分词工具(一)
  7. ant+jmeter中build.xml配置详解
  8. ExtJs4.1布局具体解释
  9. 《从零開始学Swift》学习笔记(Day 52)——Cocoa错误处理模式
  10. Extjs TabPanel页签转换事件