MCPcopy
hub / github.com/garrytan/gstack / writeSecureFile

Function writeSecureFile

browse/src/file-permissions.ts:118–124  ·  view source on GitHub ↗
(
  filePath: string,
  data: string | NodeJS.ArrayBufferView,
)

Source from the content-addressed store, hash-verified

116 * Replaces `fs.writeFileSync(path, data, { mode: 0o600 })` + Windows ACL.
117 */
118export function writeSecureFile(
119 filePath: string,
120 data: string | NodeJS.ArrayBufferView,
121): void {
122 fs.writeFileSync(filePath, data, { mode: 0o600 });
123 restrictFilePermissions(filePath);
124}
125
126/**
127 * Append to a file with owner-only permissions, cross-platform.

Callers 14

getDeviceSaltFunction · 0.90
writeSessionStateFunction · 0.90
writeDecisionFunction · 0.90
handleMetaCommandFunction · 0.90
launchHeadedMethod · 0.90
writeAgentRecordFunction · 0.90
writeClaudeAvailableFunction · 0.90
handleTabStateFunction · 0.90
handleTabSwitchFunction · 0.90
mainFunction · 0.90
terminal-agent.tsFile · 0.90

Calls 1

restrictFilePermissionsFunction · 0.85

Tested by

no test coverage detected