MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / readBinaryLockOwner

Function readBinaryLockOwner

pkg/npm/install.js:397–410  ·  view source on GitHub ↗
(lockPath)

Source from the content-addressed store, hash-verified

395}
396
397function readBinaryLockOwner(lockPath) {
398 try {
399 const owner = JSON.parse(
400 fs.readFileSync(path.join(lockPath, 'owner.json'), 'utf8'),
401 );
402 if (!Number.isSafeInteger(owner.pid) || owner.pid <= 0 ||
403 typeof owner.token !== 'string' || !/^[0-9a-f]{32}$/.test(owner.token)) {
404 return null;
405 }
406 return owner;
407 } catch (_) {
408 return null;
409 }
410}
411
412function tryReclaimBinaryLock(lockPath, contenderToken) {
413 let reclaim = false;

Callers 2

tryReclaimBinaryLockFunction · 0.85
releaseWindowsBinaryLockFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected