Skip to content

Commit

Permalink
Merge pull request #60 from xushiwei/cached
Browse files Browse the repository at this point in the history
cached/dir: WriteEntry => WriteFileInfo
  • Loading branch information
xushiwei authored Sep 3, 2023
2 parents 4b0a53d + a26f40c commit 82a74a5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion http/fs/cached/dir/dir_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (p *entryHdr) read(b []byte) ([]byte, error) {
return b[24:], nil
}

func WriteEntry(b []byte, fi fs.FileInfo) []byte {
func WriteFileInfo(b []byte, fi fs.FileInfo) []byte {
binary.LittleEndian.PutUint64(b, uint64(fi.Size()))
binary.LittleEndian.PutUint64(b[8:], uint64(fi.ModTime().UnixMicro()))
binary.LittleEndian.PutUint32(b[16:], uint32(fi.Mode()))
Expand Down
2 changes: 1 addition & 1 deletion http/fs/lfs/_dircache/readdir.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func ReaddirAll(localDir string, dir *os.File) (fis []fs.FileInfo, err error) {
fi = remoteStat(localFile, fi)
fis[i] = fi
}
b = dircache.WriteEntry(b, fi)
b = dircache.WriteFileInfo(b, fi)
}
os.WriteFile(cacheFile, data, 0666)
return
Expand Down

0 comments on commit 82a74a5

Please sign in to comment.