redirect to file
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: redirect to file

  1. #1
    Join Date
    Oct 2009
    Posts
    29

    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?.

  2. #2
    Join Date
    Apr 2009
    Posts
    598

    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 08: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
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center