Sub creates and opens a rooted subdirectory.
(name string, perm os.FileMode)
| 119 | |
| 120 | // Sub creates and opens a rooted subdirectory. |
| 121 | func (r *Root) Sub(name string, perm os.FileMode) (*Root, error) { |
| 122 | local, err := r.localPath(name) |
| 123 | if err != nil { |
| 124 | return nil, err |
| 125 | } |
| 126 | root, err := r.openDirectories(local, perm) |
| 127 | if err != nil { |
| 128 | return nil, err |
| 129 | } |
| 130 | |
| 131 | return &Root{ |
| 132 | root: root, |
| 133 | openRoot: r.openRoot, |
| 134 | openFile: r.openFile, |
| 135 | lstat: r.lstat, |
| 136 | readlink: r.readlink, |
| 137 | stat: r.stat, |
| 138 | }, nil |
| 139 | } |
| 140 | |
| 141 | // MkdirAll creates a directory path without traversing symbolic links. |
| 142 | func (r *Root) MkdirAll(name string, perm os.FileMode) error { |