You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
buildx/vendor/github.com/moby/buildkit/util/system/atime_unix.go

22 lines
408 B
Go

//go:build !windows
// +build !windows
package system
import (
iofs "io/fs"
"syscall"
"time"
"github.com/containerd/continuity/fs"
"github.com/pkg/errors"
)
func Atime(st iofs.FileInfo) (time.Time, error) {
stSys, ok := st.Sys().(*syscall.Stat_t)
if !ok {
return time.Time{}, errors.Errorf("expected st.Sys() to be *syscall.Stat_t, got %T", st.Sys())
}
return fs.StatATimeAsTime(stSys), nil
}