AccessTime helper moved to missinggo
This commit is contained in:
parent
5b52769523
commit
665e3c72fc
|
@ -1,12 +0,0 @@
|
|||
package blob
|
||||
|
||||
import (
|
||||
"os"
|
||||
"syscall"
|
||||
"time"
|
||||
)
|
||||
|
||||
func accessTime(fi os.FileInfo) time.Time {
|
||||
ts := fi.Sys().(*syscall.Stat_t).Atimespec
|
||||
return time.Unix(ts.Sec, ts.Nano())
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package blob
|
||||
|
||||
import (
|
||||
"os"
|
||||
"syscall"
|
||||
"time"
|
||||
)
|
||||
|
||||
func accessTime(fi os.FileInfo) time.Time {
|
||||
ts := fi.Sys().(*syscall.Stat_t).Atim
|
||||
return time.Unix(ts.Sec, ts.Nano())
|
||||
}
|
|
@ -13,6 +13,8 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anacrolix/missinggo"
|
||||
|
||||
dataPkg "github.com/anacrolix/torrent/data"
|
||||
"github.com/anacrolix/torrent/metainfo"
|
||||
)
|
||||
|
@ -186,7 +188,7 @@ func (me fileInfoSorter) Len() int {
|
|||
|
||||
func lastTime(fi os.FileInfo) (ret time.Time) {
|
||||
ret = fi.ModTime()
|
||||
atime := accessTime(fi)
|
||||
atime := missinggo.FileInfoAccessTime(fi)
|
||||
if atime.After(ret) {
|
||||
ret = atime
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue