2023-10-16 09:18:40 +00:00
|
|
|
package vfs
|
2020-09-27 19:23:47 +00:00
|
|
|
|
2023-12-21 23:15:39 +00:00
|
|
|
import (
|
|
|
|
"io/fs"
|
|
|
|
"path"
|
|
|
|
)
|
2020-09-27 19:23:47 +00:00
|
|
|
|
2023-12-21 23:15:39 +00:00
|
|
|
var _ File = &dir{}
|
|
|
|
|
|
|
|
func NewDir(name string) File {
|
|
|
|
return &dir{
|
|
|
|
name: path.Base(name),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
type dir struct {
|
|
|
|
name string
|
|
|
|
}
|
|
|
|
|
|
|
|
// Info implements File.
|
|
|
|
func (d *dir) Stat() (fs.FileInfo, error) {
|
|
|
|
return newDirInfo(d.name), nil
|
2020-09-27 19:23:47 +00:00
|
|
|
}
|
|
|
|
|
2023-12-21 23:15:39 +00:00
|
|
|
func (d *dir) Size() int64 {
|
2020-09-27 19:23:47 +00:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2023-12-21 23:15:39 +00:00
|
|
|
func (d *dir) IsDir() bool {
|
2020-09-27 19:23:47 +00:00
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2023-12-21 23:15:39 +00:00
|
|
|
func (d *dir) Close() error {
|
2020-09-27 19:23:47 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-12-21 23:15:39 +00:00
|
|
|
func (d *dir) Read(p []byte) (n int, err error) {
|
2020-09-27 19:23:47 +00:00
|
|
|
return 0, nil
|
|
|
|
}
|
|
|
|
|
2023-12-21 23:15:39 +00:00
|
|
|
func (d *dir) ReadAt(p []byte, off int64) (n int, err error) {
|
2020-09-27 19:23:47 +00:00
|
|
|
return 0, nil
|
|
|
|
}
|