You will need to explain more why you can’t let your C program finish writing to the file, and then start your simulation.
Inter-process communication (IPC) will be required if you cannot run the C program first, and that will be OS specific.
A better solution might be to integrate the C program using the SystemVerilog DPI and avoid communicating through a file.