-
December 3rd, 2009, 05:51 AM
#1
redirect to file
I have a console application that when runs i like to capture its console output and send to a file. any line as console gets updated should get appended to file. Any sample code or piece of working code?.
-
December 3rd, 2009, 09:30 AM
#2
Re: redirect to file
If your command line looks like
Code:
prg_one.exe | prg_two.exe
Then, in prg_two.exe, you can read output data from prg_one.exe, with statements about files (fopen, fread, fclose if you progream in C), but with stdin instead of the name of a file when you open your file. But it more simple to write
Code:
prg_one.exe >somefile.txt
Or if your operating system is Unix, you might like to use tail -f
Last edited by olivthill2; December 3rd, 2009 at 09:33 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|