quilltap 4.7.0-dev.129 → 4.8.0-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/file-verify-commands.js +11 -4
- package/package.json +1 -1
|
@@ -28,11 +28,18 @@ const READ_CHUNK_BYTES = 8 * 1024 * 1024;
|
|
|
28
28
|
|
|
29
29
|
// ---------- detection (platform seam) ----------
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
//
|
|
31
|
+
const STAT_BLOCK_BYTES = 512;
|
|
32
|
+
|
|
33
|
+
// macOS not-fully-materialized heuristic: a real file (size > 0) whose locally
|
|
34
|
+
// allocated blocks hold fewer bytes than its size has not finished downloading.
|
|
35
|
+
// Covers both the fully-evicted placeholder (blocks === 0, mirrors SF_DATALESS)
|
|
36
|
+
// and the partially-materialized file (blocks > 0 but blocks*512 < size) — the
|
|
37
|
+
// latter still fails SQLite open with "file is not a database". A fully-resident
|
|
38
|
+
// file always reports blocks*512 >= size (allocation rounds up), so this never
|
|
39
|
+
// flags a healthy file. Zero-byte files are never flagged. Other platforms fall
|
|
40
|
+
// through as a no-op for now.
|
|
34
41
|
function isDatalessStat(stat) {
|
|
35
|
-
return stat.size > 0 && stat.blocks
|
|
42
|
+
return stat.size > 0 && stat.blocks * STAT_BLOCK_BYTES < stat.size;
|
|
36
43
|
}
|
|
37
44
|
|
|
38
45
|
function listTopLevelFiles(dataDir) {
|