mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-16 17:51:42 +00:00
12 lines
387 B
TypeScript
12 lines
387 B
TypeScript
import fs from "node:fs";
|
|
|
|
export function fileFingerprint(filePath: string): unknown {
|
|
try {
|
|
const stat = fs.statSync(filePath, { bigint: true });
|
|
const kind = stat.isFile() ? "file" : stat.isDirectory() ? "dir" : "other";
|
|
return [filePath, kind, stat.size.toString(), stat.mtimeNs.toString(), stat.ctimeNs.toString()];
|
|
} catch {
|
|
return [filePath, "missing"];
|
|
}
|
|
}
|