2014-03-08 22:02:01 +00:00
|
|
|
package scanner
|
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
|
|
|
|
type File struct {
|
2014-03-16 07:14:55 +00:00
|
|
|
Name string
|
|
|
|
Flags uint32
|
|
|
|
Modified int64
|
2014-03-28 13:36:57 +00:00
|
|
|
Version uint64
|
2014-03-16 07:14:55 +00:00
|
|
|
Size int64
|
|
|
|
Blocks []Block
|
|
|
|
Suppressed bool
|
2014-03-08 22:02:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (f File) String() string {
|
2014-03-28 13:36:57 +00:00
|
|
|
return fmt.Sprintf("File{Name:%q, Flags:0%o, Modified:%d, Version:%d, Size:%d, NumBlocks:%d}",
|
2014-03-08 22:02:01 +00:00
|
|
|
f.Name, f.Flags, f.Modified, f.Version, f.Size, len(f.Blocks))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (f File) Equals(o File) bool {
|
|
|
|
return f.Modified == o.Modified && f.Version == o.Version
|
|
|
|
}
|
|
|
|
|
|
|
|
func (f File) NewerThan(o File) bool {
|
|
|
|
return f.Modified > o.Modified || (f.Modified == o.Modified && f.Version > o.Version)
|
|
|
|
}
|