I have a closed program (namely Intersystems ‘csession’ Cachédb terminal) that will write to a file given as a parameter. It do so several times, as then returns. Each time, the given file is overwritten, so at the end, I only get the last result…
I had the idea that it might be possible to trick and give a special pseudo-file as a parameter, that would act as a proxy and append what is written into it into another file.
create proxyfile as >> realfile
cat "Hello" > proxyfile
cat "Bye" > proxyfile
cat realfile
Hello
Bye
Does anyone think this might be doable, possibly using a little utility ?
You can use a FIFO file (named pipe) for this purpose. To see how they work, open up two terminal windows. In one, do
and in the other
For the actual problem, let your application write to the FIFO and use
tail -f pipe > outputfilein the background to gather the results intooutputfile.