This repository has been archived on 2023-08-08. You can view files and clone it, but cannot push or open issues or pull requests.
tomo-old/elements/fs.go
2023-04-18 18:37:50 -04:00

26 lines
520 B
Go

package elements
import "os"
import "io/fs"
// ReadDirStatFS is a combination of fs.ReadDirFS and fs.StatFS. It is the
// minimum filesystem needed to satisfy a directory view.
type ReadDirStatFS interface {
fs.ReadDirFS
fs.StatFS
}
type defaultFS struct { }
func (defaultFS) Open (name string) (fs.File, error) {
return os.Open(name)
}
func (defaultFS) ReadDir (name string) ([]fs.DirEntry, error) {
return os.ReadDir(name)
}
func (defaultFS) Stat (name string) (fs.FileInfo, error) {
return os.Stat(name)
}