[Rails] Re: Re: interactive web app

User
Wed, 05 Jul 2006 14:42:23 -0000

nvm, you have to flush the output in the binary you are running for you
to access it.  however, I noticed that redirecting output interpreted \n
as a newline instead of just directing \n as a string to the text file.
How do I prevent that?

thanks

User wrote:
> I do not think you can read while a file is being written to.  For
> example, I ran a program that is in an infinite loop that prints Foo,
> sleeps for 10 seconds, then prints Bar.  I redirected the output to
> log.txt.  I opened the txt file each time, and saw nothing on the text
> file.  When I abnormally closed the program, the text file had all the
> output.
>
> Mathias Wittlock wrote:
>> On 7/5/06, User <exl2@cornell.edu> wrote:
>>> but how do i redirect the stdout to a file if it is constantly
being
>>> written (the program does not end, it will keep writing to stdout )
>>>
>>> thanks
>>>
>>
>> I believe the file gets written to while the application is running
>> (compare with logfiles). Instead of printing it in the console it just
>> writes to the file. So the file will get updated every couple of
>> seconds as the program outputs more text.
>>
>> Mathias.