| Thread overview | |||||
|---|---|---|---|---|---|
|
May 12, 2011 redirect stdout stdio writeln | ||||
|---|---|---|---|---|
| ||||
Hi ! someone could say me if it's possible to redirect stdout of a program running in background to a file. I use writeln() to debug, I would like to redirect results of writeln() into file. I tried : program >> /tmp/log 2>&1 program >> /tmp/log program &> /tmp/log ...never success. so maybe it's not possible with writeln or I'm missing something. Thanks ! | ||||
May 12, 2011 Re: redirect stdout stdio writeln | ||||
|---|---|---|---|---|
| ||||
Posted in reply to GG | GG Wrote:
> Hi !
> someone could say me if it's possible to redirect stdout of a program running
> in background to a file.
> I use writeln() to debug, I would like to redirect results of writeln() into
> file. I tried :
> program >> /tmp/log 2>&1
> program >> /tmp/log
> program &> /tmp/log
> ...never success.
>
> so maybe it's not possible with writeln or I'm missing something.
>
> Thanks !
That should work I usually just use > but no reason append shouldn't work. In fact that method of redirection is purely on your shell to handle.
| |||
May 12, 2011 Re: redirect stdout stdio writeln | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Jesse Phillips | Ok I found it, I have to put stdout.writeln not writeln. But don't know why we have to force like this. More strange, I only changed the first writeln to stdout.writeln and all next writeln will print in file too !!! If someone know why, I would like to understand. Thanks. | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply