2015-05-05 23:06:36 +00:00
|
|
|
package restic
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"syscall"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (node *Node) OpenForReading() (*os.File, error) {
|
2015-05-06 01:47:02 +00:00
|
|
|
return os.OpenFile(node.path, os.O_RDONLY, 0)
|
2015-05-05 23:06:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (node *Node) fillTimes(stat *syscall.Stat_t) {
|
|
|
|
node.ChangeTime = time.Unix(stat.Ctimespec.Unix())
|
|
|
|
node.AccessTime = time.Unix(stat.Atimespec.Unix())
|
|
|
|
}
|
|
|
|
|
|
|
|
func changeTime(stat *syscall.Stat_t) time.Time {
|
|
|
|
return time.Unix(stat.Ctimespec.Unix())
|
|
|
|
}
|