README
¶
third_party/symlink
This came from github.com/docker/docker/pkg/symlink
, and has some
modifications to remove windows support and also remove the usage of Docker's
system
pkg.
Package symlink implements EvalSymlinksInScope which is an extension of filepath.EvalSymlinks, as well as a Windows long-path aware version of filepath.EvalSymlinks from the Go standard library.
The code from filepath.EvalSymlinks has been adapted in fs.go
. Please read
the LICENSE.BSD
file that governs fs{,_unix}.go
and LICENSE.APACHE
for
fs_unix_test.go
.
Modifications
Note that that this is in fact a fork of Docker's symlink package, because we
needed to add support for unprivileged os.Lstat
-- which cannot be wrapped
safely due to the unsafety of the passed directory (and the fact that the
symlink expansion changes how things are handled).
Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EvalSymlinks ¶
EvalSymlinks returns the path name after the evaluation of any symbolic links. If path is relative the result will be relative to the current directory, unless one of the components is an absolute symbolic link. This version has been updated to support long paths prepended with `\\?\`.
Types ¶
type FsEval ¶
type FsEval interface { Lstat(path string) (fi os.FileInfo, err error) Readlink(path string) (linkname string, err error) }
FsEval is a mock-friendly (and unpriv.*) friendly way of wrapping filesystem-related functions. Note that this code (and all code referencing it) comes from this fork and is not present in the upstream code.