2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-09 23:00:57 +00:00
restic/internal/node_unix.go
Alexander Neumann 83d1a46526 Moves files
2017-07-23 14:19:13 +02:00

33 lines
785 B
Go

// +build dragonfly linux netbsd openbsd freebsd solaris darwin
package restic
import (
"os"
"syscall"
)
var mknod = syscall.Mknod
var lchown = os.Lchown
type statUnix syscall.Stat_t
func toStatT(i interface{}) (statT, bool) {
if i == nil {
return nil, false
}
s, ok := i.(*syscall.Stat_t)
if ok && s != nil {
return statUnix(*s), true
}
return nil, false
}
func (s statUnix) dev() uint64 { return uint64(s.Dev) }
func (s statUnix) ino() uint64 { return uint64(s.Ino) }
func (s statUnix) nlink() uint64 { return uint64(s.Nlink) }
func (s statUnix) uid() uint32 { return uint32(s.Uid) }
func (s statUnix) gid() uint32 { return uint32(s.Gid) }
func (s statUnix) rdev() uint64 { return uint64(s.Rdev) }
func (s statUnix) size() int64 { return int64(s.Size) }