Update Vendor
(*) github.com/Microsoft/hcsshim (*) golang.org/x/sys (*) github.com/x/cyrpto (*) github.com/sirupsen/logrus (*) github.com/Microsoft/go-winio (*) github.com/juju/errors (*) github.com/buger/jsonparser
This commit is contained in:
24
vendor/github.com/Microsoft/hcsshim/internal/longpath/longpath.go
generated
vendored
Normal file
24
vendor/github.com/Microsoft/hcsshim/internal/longpath/longpath.go
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
package longpath
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// LongAbs makes a path absolute and returns it in NT long path form.
|
||||
func LongAbs(path string) (string, error) {
|
||||
if strings.HasPrefix(path, `\\?\`) || strings.HasPrefix(path, `\\.\`) {
|
||||
return path, nil
|
||||
}
|
||||
if !filepath.IsAbs(path) {
|
||||
absPath, err := filepath.Abs(path)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
path = absPath
|
||||
}
|
||||
if strings.HasPrefix(path, `\\`) {
|
||||
return `\\?\UNC\` + path[2:], nil
|
||||
}
|
||||
return `\\?\` + path, nil
|
||||
}
|
Reference in New Issue
Block a user