OpenRootDir creates and opens a user-selected directory as a rooted filesystem. The selected path may contain symbolic links; child paths beneath the opened root may not.
(path string, perm os.FileMode)
| 59 | // The selected path may contain symbolic links; child paths beneath the opened |
| 60 | // root may not. |
| 61 | func OpenRootDir(path string, perm os.FileMode) (*Root, error) { |
| 62 | if path == "" { |
| 63 | path = "." |
| 64 | } |
| 65 | if err := os.MkdirAll(path, perm); err != nil { |
| 66 | return nil, err |
| 67 | } |
| 68 | return OpenRoot(path) |
| 69 | } |
| 70 | |
| 71 | // OpenFile creates a file without traversing symbolic links below its rooted |
| 72 | // parent. Creation is always exclusive, including when replace is false. |