Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Plan 9 from Bell Labs
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Union directories and namespaces === {{anchor|Union directory|Name}} Plan 9 allows the user to collect the files (called ''names'') from different directory trees in a single location. The resulting ''[[Union (set theory)|union]] directory'' behaves as the concatenation of the underlying directories (the order of concatenation can be controlled); if the constituent directories contain files having the same name, a listing of the union directory ({{mono|ls}} or {{mono|lc}}) will simply report duplicate names.{{r|valerie-aurora}} Resolution of a single path name is performed top-down: if the directories {{mono|top}} and {{mono|bottom}} are unioned into {{mono|u}} with {{mono|top}} first, then {{mono|u/name}} denotes {{mono|top/name}} if it exists, {{mono|bottom/name}} only if it exists ''and {{mono|top/name}} does not exist'', and no file if neither exists. No recursive unioning of subdirectories is performed, so if {{mono|top/subdir}} exists, the files in {{mono|bottom/subdir}} are not accessible through the union.{{r|4.4bsd}} A union directory can be created by using a sequence of {{mono|bind}} commands: <pre> bind /arm/bin /bin bind -a /acme/bin/arm /bin bind -b /usr/alice/bin /bin </pre> In the example above, {{mono|/arm/bin}} is mounted at {{mono|/bin}}, the contents of {{mono|/arm/bin}} replacing the previous contents of {{mono|/bin}}. [[Acme (text editor)|Acme]]'s {{mono|bin}} directory is then union mounted after {{mono|/bin}}, and Alice's personal {{mono|bin}} directory is union mounted before. When a file is requested from {{mono|/bin}}, it is first looked for in {{mono|/usr/alice/bin}}, then in {{mono|/arm/bin}}, and then finally in {{mono|/acme/bin/arm}}. The separate process namespaces thus usually replace the notion of a [[PATH (variable)|search path]] in the shell. A path environment variable ({{code|$path}}) still exists in the [[Rc (Unix shell)|rc]] shell (the shell mainly used in Plan 9); however, rc's path environment variable conventionally only contains the {{code|/bin}} and {{code|.}} directories and modifying the variable is discouraged, instead, adding additional commands should be done by binding several directories together as a single {{code|/bin}}.<ref name="rc_the_plan_9_shell">{{cite book |last1=Duff |first1=Tom |title=Rc β The Plan 9 Shell |url=http://doc.cat-v.org/plan_9/4th_edition/papers/rc|section=18|work=Plan 9, 4th edition}} ([https://www.scs.stanford.edu/nyu/04fa/sched/readings/rc.pdf PDF]);</ref><ref name= "distributed-system" /> Unlike in Plan 9, the path environment variable of Unix shells should be set to include the additional directories whose executable files need to be added as commands. Furthermore, the kernel can keep separate mount tables for each process,<ref name="HerbertJones2004"/> and can thus provide each process with its own file system [[namespace]]. Processes' namespaces can be constructed independently, and the user may work simultaneously with programs that have heterogeneous namespaces.<ref name = "use-of-namespaces" /> Namespaces may be used to create an isolated environment similar to [[chroot]], but in a more secure way.<ref name="unix-spirit-set-free" /> Plan 9's union directory architecture inspired [[4.4BSD]] and [[Linux]] [[union mount|union file system]] implementations,{{r|valerie-aurora}} although the developers of the BSD union mounting facility found the non-recursive merging of directories in Plan 9 "too restrictive for general purpose use".{{r|4.4bsd}} {{clear}}
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Plan 9 from Bell Labs
(section)
Add topic