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

Function readBinaryLockOwner

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

Source from the content-addressed store, hash-verified

257}
258
259function readBinaryLockOwner(lockPath) {
260 try {
261 const owner = JSON.parse(
262 fs.readFileSync(path.join(lockPath, 'owner.json'), 'utf8'),
263 );
264 if (!Number.isSafeInteger(owner.pid) || owner.pid <= 0 ||
265 typeof owner.token !== 'string' || !/^[0-9a-f]{32}$/.test(owner.token)) {
266 return null;
267 }
268 return owner;
269 } catch (_) {
270 return null;
271 }
272}
273
274function tryReclaimBinaryLock(lockPath, contenderToken) {
275 let reclaim = false;

Callers 2

tryReclaimBinaryLockFunction · 0.85
releaseWindowsBinaryLockFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected