Root restricts filesystem operations to a directory tree and refuses to traverse symbolic links below that directory. The caller owns each returned Root and must call Close when it is no longer needed.
| 15 | // The caller owns each returned Root and must call Close when it is |
| 16 | // no longer needed. |
| 17 | type Root struct { |
| 18 | root *os.Root |
| 19 | openRoot func(*os.Root, string) (*os.Root, error) |
| 20 | openFile func(*os.Root, string, int, os.FileMode) (*os.File, error) |
| 21 | lstat func(*os.Root, string) (os.FileInfo, error) |
| 22 | readlink func(*os.Root, string) (string, error) |
| 23 | stat func(*os.Root, string) (os.FileInfo, error) |
| 24 | } |
| 25 | |
| 26 | // OpenRoot opens an existing directory as a rooted filesystem. |
| 27 | func OpenRoot(path string) (*Root, error) { |
nothing calls this directly
no outgoing calls
no test coverage detected