mirror of
https://github.com/rclone/rclone.git
synced 2026-01-03 09:03:50 +00:00
vendor: update dependencies to latest
This commit is contained in:
4
vendor/github.com/djherbis/times/.travis.yml
generated
vendored
4
vendor/github.com/djherbis/times/.travis.yml
generated
vendored
@@ -1,8 +1,8 @@
|
||||
language: go
|
||||
go:
|
||||
- 1.5
|
||||
- tip
|
||||
before_install:
|
||||
- go get github.com/golang/lint/golint
|
||||
- go get -u golang.org/x/lint/golint
|
||||
- go get github.com/axw/gocov/gocov
|
||||
- go get github.com/mattn/goveralls
|
||||
- if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover;
|
||||
|
||||
1
vendor/github.com/djherbis/times/README.md
generated
vendored
1
vendor/github.com/djherbis/times/README.md
generated
vendored
@@ -7,6 +7,7 @@ times
|
||||
[](https://travis-ci.org/djherbis/times)
|
||||
[](https://coveralls.io/r/djherbis/times?branch=master)
|
||||
[](https://goreportcard.com/report/github.com/djherbis/times)
|
||||
[](https://sourcegraph.com/github.com/djherbis/times?badge)
|
||||
|
||||
Usage
|
||||
------------
|
||||
|
||||
68
vendor/github.com/djherbis/times/ctime_windows.go
generated
vendored
68
vendor/github.com/djherbis/times/ctime_windows.go
generated
vendored
@@ -7,6 +7,26 @@ import (
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
// Stat returns the Timespec for the given filename.
|
||||
func Stat(name string) (Timespec, error) {
|
||||
ts, err := platformSpecficStat(name)
|
||||
if err == nil {
|
||||
return ts, err
|
||||
}
|
||||
|
||||
return stat(name, os.Stat)
|
||||
}
|
||||
|
||||
// Lstat returns the Timespec for the given filename, and does not follow Symlinks.
|
||||
func Lstat(name string) (Timespec, error) {
|
||||
ts, err := platformSpecficLstat(name)
|
||||
if err == nil {
|
||||
return ts, err
|
||||
}
|
||||
|
||||
return stat(name, os.Lstat)
|
||||
}
|
||||
|
||||
type timespecEx struct {
|
||||
atime
|
||||
mtime
|
||||
@@ -33,20 +53,54 @@ func statFile(h syscall.Handle) (Timespec, error) {
|
||||
return t, nil
|
||||
}
|
||||
|
||||
const hasPlatformSpecificStat = true
|
||||
func platformSpecficLstat(name string) (Timespec, error) {
|
||||
if findProcErr != nil {
|
||||
return nil, findProcErr
|
||||
}
|
||||
|
||||
isSym, err := isSymlink(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var attrs = uint32(syscall.FILE_FLAG_BACKUP_SEMANTICS)
|
||||
if isSym {
|
||||
attrs |= syscall.FILE_FLAG_OPEN_REPARSE_POINT
|
||||
}
|
||||
|
||||
return openHandleAndStat(name, attrs)
|
||||
}
|
||||
|
||||
func isSymlink(name string) (bool, error) {
|
||||
fi, err := os.Lstat(name)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
return fi.Mode()&os.ModeSymlink != 0, nil
|
||||
}
|
||||
|
||||
func platformSpecficStat(name string) (Timespec, error) {
|
||||
if findProcErr != nil {
|
||||
return nil, findProcErr
|
||||
}
|
||||
|
||||
f, err := os.Open(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer f.Close()
|
||||
return openHandleAndStat(name, syscall.FILE_FLAG_BACKUP_SEMANTICS)
|
||||
}
|
||||
|
||||
return statFile(syscall.Handle(f.Fd()))
|
||||
func openHandleAndStat(name string, attrs uint32) (Timespec, error) {
|
||||
pathp, e := syscall.UTF16PtrFromString(name)
|
||||
if e != nil {
|
||||
return nil, e
|
||||
}
|
||||
h, e := syscall.CreateFile(pathp,
|
||||
syscall.FILE_WRITE_ATTRIBUTES, syscall.FILE_SHARE_WRITE, nil,
|
||||
syscall.OPEN_EXISTING, attrs, 0)
|
||||
if e != nil {
|
||||
return nil, e
|
||||
}
|
||||
defer syscall.Close(h)
|
||||
|
||||
return statFile(h)
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
11
vendor/github.com/djherbis/times/times.go
generated
vendored
11
vendor/github.com/djherbis/times/times.go
generated
vendored
@@ -11,15 +11,10 @@ func Get(fi os.FileInfo) Timespec {
|
||||
return getTimespec(fi)
|
||||
}
|
||||
|
||||
// Stat returns the Timespec for the given filename.
|
||||
func Stat(name string) (Timespec, error) {
|
||||
if hasPlatformSpecificStat {
|
||||
if ts, err := platformSpecficStat(name); err == nil {
|
||||
return ts, nil
|
||||
}
|
||||
}
|
||||
type statFunc func(string) (os.FileInfo, error)
|
||||
|
||||
fi, err := os.Stat(name)
|
||||
func stat(name string, sf statFunc) (Timespec, error) {
|
||||
fi, err := sf(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
13
vendor/github.com/djherbis/times/use_generic_stat.go
generated
vendored
13
vendor/github.com/djherbis/times/use_generic_stat.go
generated
vendored
@@ -2,9 +2,14 @@
|
||||
|
||||
package times
|
||||
|
||||
const hasPlatformSpecificStat = false
|
||||
import "os"
|
||||
|
||||
// do not use, only here to prevent "undefined" method error.
|
||||
func platformSpecficStat(name string) (Timespec, error) {
|
||||
return nil, nil
|
||||
// Stat returns the Timespec for the given filename.
|
||||
func Stat(name string) (Timespec, error) {
|
||||
return stat(name, os.Stat)
|
||||
}
|
||||
|
||||
// Lstat returns the Timespec for the given filename, and does not follow Symlinks.
|
||||
func Lstat(name string) (Timespec, error) {
|
||||
return stat(name, os.Lstat)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user