MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / ensureFileExists

Function ensureFileExists

lib/utils.ts:664–667  ·  view source on GitHub ↗
(filepath: string)

Source from the content-addressed store, hash-verified

662 * Create an empty file (and directories leading to it), leaving it alone if already present.
663 */
664export async function ensureFileExists(filepath: string): Promise<void> {
665 await fs.mkdir(path.dirname(filepath), {recursive: true});
666 await (await fs.open(filepath, 'a')).close();
667}

Callers

nothing calls this directly

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected