Plan9 文件类型

发布于 2024-11-03 17:57:38 字数 96 浏览 4 评论 0原文

据说在9号计划中,一切都是档案。

请列出所有内容,

即 plan9 中文件系统中表示的所有内容(尤其是 *nix os-es 中不是文件的内容)。

It has been said that in plan 9 everything is a file.

Please list everything,

i.e. all things represented in the filesystem in plan9(especially things that are not files in *nix os-es).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

晌融 2024-11-10 17:57:38

“一切都是文件”并不完全正确,而是大多数东西都有一个类似文件的接口。这看起来像是吹毛求疵,但还是有区别的。我不认为我能够列出所有内容,但我会给你一些例子。

  • TCP/IP 的接口是一个文件系统,/net 公开“文件”。
  • 文本编辑器 acme 具有关联的控制文件,可以向其中写入文本命令以更改文本中的文本。 window
  • 鼠标和键盘表示为数据文件,例如 /dev/mouse
  • 窗口系统 rio 公开文件系统接口
  • Web 浏览器 abaco从已安装的读取webfs 文件系统

有趣的是,什么样的交互会“脱离”这种安排。由于大多数内容都是文件中某处的文本,因此您可以使用普通的 shell 脚本来实现 IRC 客户端之类的功能(直接将文本读/写到网络“文件”)。

/sys/doc 目录中有很多论文(以及 web) 关于计划 9 的设计和实施。

It is not totally true that "everything is a file" but rather that most things have a file-like interface. It may seem like splitting hairs, but there's a difference. I don't think that I'll be able to list everything, but I'll give you some examples.

  • The interface for TCP/IP is a filesystem, /net exposes "files"
  • The text editor acme has associated control files to which textual commands may be written to change text in the window
  • The mouse and keyboard are represented as data files, /dev/mouse for example
  • The windowing system rio exposes a filesystem interface
  • The web browser abaco reads from a mounted webfs filesystem

The interesting thing is what sort of interaction "falls out" of this arrangement. Since most everything is text in a file somewhere, you can use normal shell scripts to implement things like an IRC client (read/write text directly to the network "file").

There are a lot of papers in the /sys/doc directory (and on the web) about the design and implementation of Plan 9.

陌上芳菲 2024-11-10 17:57:38

要获得(几乎)完整的列表,请查看手册部分3 个设备 和 4 个文件服务器

基本思想是所有资源看起来都像文件系统。内核以设备的形式公开资源,以文件服务器的形式公开用户程序。

这允许在网络环境中轻松共享资源。例如,要使用连接到另一个工作站的鼠标,您只需映射(Plan 9 术语中的“绑定”)/dev/mouse 从该工作站到您的名称空间。要使用另一台机器作为所有 TCP 连接的代理,只需绑定 /net/tcp 从该机器进入您的名称空间。

所有细节都经过深思熟虑,并且该系统在实践中运行良好。浏览文档手册页,如果您之后仍然好奇,请尝试一下安装它 看看自己。

For a (nearly) complete list have a look at manual sections 3 devices and 4 file servers.

The basic idea is that all resources look like file systems. The kernel exposes resources in the form of devices and user programs in the form of file servers.

This allows for easy sharing of resources in a networked environment. E.g. to use the mouse that is connected to another workstation, you just map (bind in Plan 9 lingo) /dev/mouse from that workstation to your name space. To use another machine as proxy for all tcp connections, just bind /net/tcp from that machine into your name space.

The details are all very well thought out and the system works nicely in practice. Browse the documents and manual pages and if you are still curious after that, give it a try and install it to see yourself.

累赘 2024-11-10 17:57:38

Plan 9 以文件系统为中心,因此它将系统的每个元素都作为文件公开,这是 UNIX 的原始哲学。通过这种方式,可以将协同作用提升到环境中,例如,您可以从网络的任何节点访问受支持的设备,而无需任何类型的配置。

Plan 9 is file-system centric, so it exposes every element of the system as a file, which was a primal philosophy of UNIX. This way a synergy is promoted into the environment and, as example, you are able to access a supported device from any node of the network, without needing any type of configuration.

℉服软 2024-11-10 17:57:38

正如twopoint718所说,Plan9服务的“风格”是提供类似文件的接口。

不可能列出“所有内容”,因为任何人都可以编写另一个服务并通过合成文件接口公开它。

我喜欢将 Plan9 风格视为基于大块对象的系统,或者正如 Alan Kay 所说:“基于消息传递”的系统。您可以通过实现这些服务器(当前范例中的微服务)来构建系统,定义它们的接口,然后通过“管道”组成的服务来集成更全面的系统。

As twopoint718 says, the "style" of Plan9 services is to provide a file-like interface.

It is impossible to list "everything" since anybody can write yet another service and expose it through a synthetic file interface.

I like to think of the Plan9 style as a big-chunk object based, or as Alan Kay says: "messaging based", system. You build systems by implementing these servers (microservices in the current paradigm), define their interfaces and then integrate ever more comprehensive systems by "plumbing" the constituent services.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文