update 2026-09-26 11:07:27

This commit is contained in:
action committed 2026-09-26 11:07:27 +08:00
1 parent 7b88b273d0
commit 97ae9f68da
4898 files changed
-1712274

No files matched your search

-28
View File
@@ -1,28 +0,0 @@
#!/usr/bin/env node
import fs from 'node:fs';
const [input, output] = process.argv.slice(2);
if (!input || !output) {
console.error('usage: strip-tar-eof.mjs <input.tar> <output.tar>');
process.exit(1);
}
const blockSize = 512;
const data = fs.readFileSync(input);
let end = data.length;
function isZeroBlock(offset) {
for (let i = offset; i < offset + blockSize; i++) {
if (data[i] !== 0)
return false;
}
return true;
}
while (end >= blockSize && isZeroBlock(end - blockSize))
end -= blockSize;
fs.writeFileSync(output, data.subarray(0, end));