MCPcopy
hub / github.com/compiler-explorer/compiler-explorer / readFile

Method readFile

lib/binaries/binary-utils.ts:141–151  ·  view source on GitHub ↗
(filepath: string, instructionSetHint?: InstructionSet)

Source from the content-addressed store, hash-verified

139 }
140
141 static async readFile(filepath: string, instructionSetHint?: InstructionSet): Promise<BinaryInfo | undefined> {
142 if (os.platform() === 'win32') {
143 return {
144 os: OSType.windows,
145 instructionSet: instructionSetHint || 'amd64',
146 };
147 }
148 const info = await executeDirect('/usr/bin/file', ['-b', filepath], {});
149 if (info.code === 0) return BinaryInfoLinux.parseFileInfo(info.stdout);
150 return undefined;
151 }
152}

Callers 15

mainFunction · 0.80
processIrOutputMethod · 0.80
generateClangirMethod · 0.80
processRustMirOutputMethod · 0.80
processLeanCOutputMethod · 0.80
processYulOutputMethod · 0.80
processOptOutputMethod · 0.80

Calls 2

executeDirectFunction · 0.85
parseFileInfoMethod · 0.80

Tested by

no test coverage detected