I just tried, and it does not work. Redirection only works if 'proc->start()'. -Yifei
On Mon, Jul 1, 2013 at 5:39 PM, Scott Aron Bloom <scott.bl...@onshorecs.com>wrote: > Yes… **** > > ** ** > > ** ** > > ** ** > > *From:* interest-bounces+scott.bloom=onshorecs....@qt-project.org [mailto: > interest-bounces+scott.bloom=onshorecs....@qt-project.org] *On Behalf Of > *Yifei > Li > *Sent:* Monday, July 01, 2013 2:25 PM > > *To:* interest@qt-project.org > *Subject:* Re: [Interest] Redirect stdout to a file**** > > ** ** > > Hi Scott,**** > > ** ** > > Are you suggesting something as follows? **** > > QProcess proc;**** > > proc.setStandardOutputFile();**** > > proc.startDetached();**** > > ** ** > > Yifei**** > > ** ** > > ** ** > > ** ** > > On Mon, Jul 1, 2013 at 5:08 PM, Scott Aron Bloom < > scott.bl...@onshorecs.com> wrote:**** > > If the goal, is to redirect stdout/stderr, and not have the call block > (static startDetached).**** > > **** > > You can still use the NON-static version of the start method**** > > **** > > Scott**** > > **** > > *From:* interest-bounces+scott.bloom=onshorecs....@qt-project.org [mailto: > interest-bounces+scott.bloom=onshorecs....@qt-project.org] *On Behalf Of > *Yifei > Li > *Sent:* Monday, July 01, 2013 1:58 PM > *To:* interest@qt-project.org**** > > > *Subject:* Re: [Interest] Redirect stdout to a file**** > > **** > > I guess dup2 needs to be called by the process, correct? But I can't > change its src code. - Yifei**** > > **** > > On Mon, Jul 1, 2013 at 4:42 PM, Guido Seifert <warg...@gmx.de> wrote:**** > > > If it is only Linux you could use dup2. > > Windows? No idea. > > Guido**** > > > > On Mon, 1 Jul 2013 16:31:19 -0400 > Yifei Li <yifl...@gmail.com> wrote: > > > Hi folks, > > > > I know this can be done using QProcess::setStandardOutputFile. > > > > However, I need to start my process using the static function > > startDetached, and still want to be able to redirect its stdout/stderr to > > another file. > > > > Any suggestions? > > > > Thanks, > > > > Yifei**** > > _______________________________________________ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest**** > > **** > > > _______________________________________________ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest**** > > ** ** >
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest