Debian Codegraph @

chtimes_nolinux.go

raw symbols SCIP
1 //go:build !linux
2 // +build !linux
3
4 package fsutil
5
6 import (
7 "os"
8 "time"
9
10 "github.com/pkg/errors"
11 )
12
13 func chtimes(path string, un int64) error {
14 mtime := time.Unix(0, un)
15 fi, err := os.Lstat(path)
16 if err != nil {
17 return errors.WithStack(err)
18 }
19 if fi.Mode()&os.ModeSymlink != 0 {
20 return nil
21 }
22 return errors.WithStack(os.Chtimes(path, mtime, mtime))
23 }