github.com/u-root/u-root@v7.0.1-0.20200915234505-ad7babab0a8e+incompatible/cmds/core/bind/bind_plan9.go (about) 1 // Copyright 2012-2020 the u-root Authors. All rights reserved 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // Bind binds new on old. 6 // 7 // Synopsis: 8 // bind [ option ... ] new old 9 // 10 // Description: 11 // Bind modifies the name space of the current 12 // process and other processes in the same name space group 13 // (see https://9p.io/magic/man2html/1/bind). 14 // 15 // Options: 16 // –b: Both files must be directories. Add the new directory to the beginning of the union directory represented by the old file. 17 // –a: Both files must be directories. Add the new directory to the end of the union directory represented by the old file. 18 // –c: This can be used in addition to any of the above to permit creation in a union directory. 19 // When a new file is created in a union directory, it is placed in the first element of the union that has been bound or mounted with the –c flag. 20 // If that directory does not have write permission, the create fails. 21 22 package main 23 24 import ( 25 "log" 26 "os" 27 28 "github.com/u-root/u-root/pkg/namespace" 29 ) 30 31 func main() { 32 mod, err := namespace.ParseArgs(os.Args) 33 if err != nil { 34 log.Fatal(err) 35 } 36 if err := mod.Modify(namespace.DefaultNamespace, &namespace.Builder{}); err != nil { 37 log.Fatal(err) 38 } 39 }