File Type Plan9

It was said that in plan 9 everything is a file.

Please list all

i.e. all things presented on the file system in plan9 (especially things that are not files in * nix os-es).

+4
source share
4 answers

It’s not entirely true that “everything is a file”, but rather that most things have a file interface. It may seem like splitting hair, but there is a difference. I do not think that I can list everything, but I will give a few examples.

  • The interface for TCP / IP is the file system, /net expands the "files"
  • The acme text editor has associated control files for which text commands can be written to change text in a window.
  • The mouse and keyboard are represented as data files, for example /dev/mouse for example
  • The rio window system provides a file system interface
  • The abaco web browser reads abaco from the installed file system

What is interesting is what kind of interaction “falls out” of this arrangement. Since most of them are text in a file, you can use ordinary shell scripts to implement such things as an IRC client (reading / writing text directly to a network file).

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

+10
source

For a (almost) complete list, see the manual sections for 3 devices and 4 file servers .

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

This makes it easy to allocate resources in a networked environment. For instance. to use a mouse connected to another workstation, you simply map (attach in Plan 9 lingo) / dev / mouse from this workstation to your name space. To use another machine as a proxy for all tcp connections, just bind / net / tcp to that machine in your namespace.

All details are very well thought out, and the system works in practice. Browse through the docs and man pages , and if you're still curious after that, try installing it to see yourself.

+4
source

Plan 9 is a file system oriented, so it provides each element of the system as a file, which was the basic philosophy of UNIX. Thus, the synergy is moving forward into the environment and, for example, you can access a supported device from any node of the network without the need for any configuration.

+1
source

According to twopoint718, the "style" of Plan9 services is to provide a file interface.

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

I like to think of the Plan9 style as an object with a big chunk, or, as Alan Kay says: "messaging system." You create systems by implementing these servers (microservices in the current paradigm), define their interfaces, and then integrate more and more comprehensive systems by plumbing the services that are part of it.

0
source

All Articles