createTempElfFile
fn
string createTempElfFile(const(ubyte)[] data, string prefix = "elftest")Create a temporary ELF file with the given data.
This function creates a temporary file in the system's temp directory with a .elf extension, writes the provided data to it, and returns the path.
Parameters
data | The byte data to write to the temporary ELF file. |
prefix | Optional prefix for the temporary file name (default: "elftest"). |
Returns
The full path to the created temporary file.
Throws
Exception if the file cannot be created or written.
Examples
ubyte[] elfData = [0x7f, 'E', 'L', 'F', ...];
string tempPath = createTempElfFile(elfData);
scope (exit) cleanupTempFile(tempPath);
// Use tempPath in tests