]>
Commit | Line | Data |
---|---|---|
9b12e4fe JC |
1 | // +build windows |
2 | ||
3 | package system | |
4 | ||
5 | import ( | |
6 | "os" | |
7 | "time" | |
8 | ) | |
9 | ||
10 | // StatT type contains status of a file. It contains metadata | |
11 | // like name, permission, size, etc about a file. | |
12 | type StatT struct { | |
13 | name string | |
14 | size int64 | |
15 | mode os.FileMode | |
16 | modTime time.Time | |
17 | isDir bool | |
18 | } | |
19 | ||
20 | // Name returns file's name. | |
21 | func (s StatT) Name() string { | |
22 | return s.name | |
23 | } | |
24 | ||
25 | // Size returns file's size. | |
26 | func (s StatT) Size() int64 { | |
27 | return s.size | |
28 | } | |
29 | ||
30 | // Mode returns file's permission mode. | |
31 | func (s StatT) Mode() os.FileMode { | |
32 | return s.mode | |
33 | } | |
34 | ||
35 | // ModTime returns file's last modification time. | |
36 | func (s StatT) ModTime() time.Time { | |
37 | return s.modTime | |
38 | } | |
39 | ||
40 | // IsDir returns whether file is actually a directory. | |
41 | func (s StatT) IsDir() bool { | |
42 | return s.isDir | |
43 | } |