Store mtime in nanoseconds so a same-second rewrite is re-hashed (closes #12)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
scan recorded mtime in whole seconds, so a file rewritten in place at the same size within the same second as its recorded mtime was classed unchanged and kept its old hashes. The walk, a file given as an operand, and the content phase's recheck now all use ModTime().UnixNano(); the change rule itself is unchanged. The column stays INTEGER and PRAGMA user_version stays 1, per the owner's ruling. A database written by an earlier build holds seconds, so its files count as changed once, at the next scan that covers them. README states the new resolution. Model: opus-5-5
This commit is contained in:
@@ -807,7 +807,7 @@ func unchangedFile(r scanRec) (fileRec, bool, error) {
|
||||
}
|
||||
|
||||
if !fi.Mode().IsRegular() || fi.Size() != r.size ||
|
||||
fi.ModTime().Unix() > r.mtime {
|
||||
fi.ModTime().UnixNano() > r.mtime {
|
||||
return fileRec{}, false, nil
|
||||
}
|
||||
|
||||
@@ -966,7 +966,7 @@ func seedRoot(ctx context.Context, root string,
|
||||
sendEvent(ctx, events, walkEvent{rec: fileRec{
|
||||
path: root,
|
||||
size: fi.Size(),
|
||||
mtime: fi.ModTime().Unix(),
|
||||
mtime: fi.ModTime().UnixNano(),
|
||||
dev: dev,
|
||||
ino: ino,
|
||||
}})
|
||||
@@ -1124,7 +1124,7 @@ func emitFile(ctx context.Context, p string, e fs.DirEntry,
|
||||
sendEvent(ctx, events, walkEvent{rec: fileRec{
|
||||
path: p,
|
||||
size: info.Size(),
|
||||
mtime: info.ModTime().Unix(),
|
||||
mtime: info.ModTime().UnixNano(),
|
||||
dev: dev,
|
||||
ino: ino,
|
||||
}})
|
||||
|
||||
Reference in New Issue
Block a user