Versions 2 to 318
new file, 138 lines
18+
19+import { lstatSync, mkdirSync, readFileSync, renameSync, statSync, writeFileSync } from "node:fs";
23+
28+
37+
43+
51+
56+
57+ /** The folder's record, or an empty one when it's missing, unreadable, or from another format or client. */
66+ if (file.format === FORMAT && file.client === clientVersion() && typeof file.files === "object" && file.files)
73+
75+ * The key of a plain file on disk and its known copy; undefined for a link, or when either is missing.
76+ * Taken once per run: a key taken before a later read is still safe to mark with, since any change
96+
97+ /** Whether the file was the same as its known copy at this key, and if so whether it held a CR; undefined: read it. */
100+ if (entry === undefined || entry.id !== key.id || key.newest >= entry.at - RACY_MS) return undefined;
103+
119+
124+
125+ /** Write the record, if anything changed. Best effort: a run that can't write it just reads more next time. */
131+ const files = Object.fromEntries([...this.#entries].map(([rel, e]) => [rel, [e.id, e.at, e.cr]]));
- MCP
- compare on this site's /mcp
- CLI
- abso diff 2 318 client/src/clean-files.ts --json
- JSON
- /christopher/abso-core/compare/2..318?file=client%2Fsrc%2Fclean-files.ts&format=json