I use the ShellExecute command to run an exe file which gets an input text file and returns an output text file. I've written it like this:
ShellExecute(mainFormHandle, 'open', 'Test.exe',
'input.txt output.txt', nil, sw_shownormal);
//Read the output file...
S_List.LoadFromFile('output.txt');
Writeln(S_List[0])
I provide the input.txt file before running this command. In each run of my program, the input file changes and so does the output file.
The problem is this: I can't see the changes in the output file! The line written in the console is from the previous file, not the newly changes one. I mean, the file in the explorer is changed but the file that I read is still the old file.
It seems a little weird, but I was wondering is there any way to refresh the output file before reading it? Or I am missing something here?
Thanks in advance.