MCPcopy Create free account
hub / github.com/EvoMap/evolver / canCreateSymlinks

Function canCreateSymlinks

test/helpers/symlink.js:41–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39let _cachedSymlink;
40
41function canCreateSymlinks() {
42 if (_cachedSymlink !== undefined) return _cachedSymlink;
43 const probe = path.join(os.tmpdir(), `evolver-symlink-probe-${process.pid}-${Date.now()}`);
44 try {
45 fs.symlinkSync('target-need-not-exist', probe);
46 try { fs.unlinkSync(probe); } catch { /* best-effort cleanup */ }
47 _cachedSymlink = true;
48 } catch {
49 _cachedSymlink = false;
50 }
51 return _cachedSymlink;
52}
53
54// Companion probe: `canMakeDirReadOnly()` returns true only when
55// `fs.chmodSync(dir, 0o555)` actually prevents the process from

Calls

no outgoing calls

Tested by

no test coverage detected