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

26 lines
520 B
Go
Raw Normal View History

package elements
2023-03-21 10:26:48 -06:00
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
}
2023-03-21 10:26:48 -06:00
type defaultFS struct { }
func (defaultFS) Open (name string) (fs.File, error) {
return os.Open(name)
}
func (defaultFS) ReadDir (name string) ([]fs.DirEntry, error) {
2023-03-21 10:26:48 -06:00
return os.ReadDir(name)
}
func (defaultFS) Stat (name string) (fs.FileInfo, error) {
2023-03-21 10:26:48 -06:00
return os.Stat(name)
}