2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-30 08:44:02 +00:00
restic/internal/fs/interface.go
Michael Eischer 7bb92dc7bd archiver: use ExtendedStat from FS interface
With this change, NodeFromFileInfo is the last function that bypasses
the FS interface in the archiver.
2024-08-31 18:05:09 +02:00

39 lines
835 B
Go

package fs
import (
"io"
"os"
)
// FS bundles all methods needed for a file system.
type FS interface {
OpenFile(name string, flag int, perm os.FileMode) (File, error)
Stat(name string) (os.FileInfo, error)
Lstat(name string) (os.FileInfo, error)
DeviceID(fi os.FileInfo) (deviceID uint64, err error)
ExtendedStat(fi os.FileInfo) ExtendedFileInfo
Join(elem ...string) string
Separator() string
Abs(path string) (string, error)
Clean(path string) string
VolumeName(path string) string
IsAbs(path string) bool
Dir(path string) string
Base(path string) string
}
// File is an open file on a file system.
type File interface {
io.Reader
io.Closer
Fd() uintptr
Readdirnames(n int) ([]string, error)
Readdir(int) ([]os.FileInfo, error)
Seek(int64, int) (int64, error)
Stat() (os.FileInfo, error)
Name() string
}