commit 8fffae3c4fb8bd753629de8519fea5b3b83621b4
parent 38bf109bc444b362a2fea385f22ba41bbd44595c
Author: Matsuda Kenji <info@mtkn.jp>
Date: Sat, 26 Aug 2023 07:24:42 +0900
add File interface
Diffstat:
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/file.go b/file.go
@@ -152,7 +152,7 @@ func (fi *FileInfo) IsDir() bool { return fi.info.IsDir() }
func (fi *FileInfo) Sys() any { return fi.stat }
func (fi *FileInfo) Qid() *Qid { return fi.Sys().(*stat).qid }
-type File struct {
+type DiskFile struct {
fs *FS // file system to which this file belongs
file fs.File // underlying file
path string // absolute path from the root of the fs.
@@ -177,6 +177,20 @@ type File struct {
*/
}
+type File interface {
+ Type() uint16
+ Dev() uint32
+ Qid() Qid
+ Mode() FileMode
+ Atime() uint32
+ Mtime() uint32
+ Length() int64
+ Name() string
+ Uid() string
+ Gid() string
+ Muid() string
+}
+
type hasQid interface {
Qid() *Qid
}