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/file/fs.go

26 lines
524 B
Go
Raw Normal View History

2023-03-21 10:26:48 -06:00
package fileElements
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)
}