-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
file_info.go
62 lines (51 loc) · 853 Bytes
/
file_info.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package ghfs
import (
"io/fs"
"time"
)
var _ fs.FileInfo = (*finfo)(nil)
var _ fs.FileInfo = (*dinfo)(nil)
type finfo struct {
name string
size int64
mode fs.FileMode
}
func (fi *finfo) Name() string {
return fi.name
}
func (fi *finfo) Size() int64 {
return fi.size
}
func (fi *finfo) Mode() fs.FileMode {
return fi.mode
}
func (fi *finfo) ModTime() time.Time {
return time.Time{}
}
func (fi *finfo) IsDir() bool {
return false
}
func (fi *finfo) Sys() interface{} {
return fi
}
type dinfo struct {
name string
}
func (d *dinfo) Name() string {
return d.name
}
func (d *dinfo) Size() int64 {
return 0
}
func (d *dinfo) Mode() fs.FileMode {
return fs.ModeDir | 0o555
}
func (d *dinfo) ModTime() time.Time {
return time.Time{}
}
func (d *dinfo) IsDir() bool {
return true
}
func (d *dinfo) Sys() interface{} {
return d.name
}