1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-30 00:00:14 +01:00
restic/internal/fs/stat_notlinux.go
greatroar e2886ba495 fs: Reimplement Stat/Lstat on Linux using statx
This gives us access to additional information, notably the birth time
of files on btrfs.
2024-10-27 10:40:12 +01:00

19 lines
593 B
Go

//go:build !linux
package fs
import "os"
// Stat returns a FileInfo describing the named file. If there is an error, it
// will be of type *PathError.
func (fs Local) Stat(name string) (os.FileInfo, error) {
return os.Stat(fixpath(name))
}
// Lstat returns the FileInfo structure describing the named file.
// If the file is a symbolic link, the returned FileInfo
// describes the symbolic link. Lstat makes no attempt to follow the link.
// If there is an error, it will be of type *PathError.
func (fs Local) Lstat(name string) (os.FileInfo, error) {
return os.Lstat(fixpath(name))
}