From mel at altk.com  Thu Apr 12 11:59:10 2007
From: mel at altk.com (mel)
Date: Thu, 12 Apr 2007 11:59:10 +0200
Subject: [Rd] printf capture
Message-ID: <461E02EE.7040105@altk.com>

printf capture

Dear All,

I'm running R-2.4.1 on WindowsXP.
I wrote a small C++ DLL using Rprintf() and all works fine
dyn.load(), is.loaded('f1'), Rprintf(), .C(), all is ok.

Now, the worry :
I use also a 3rd party piece of C++ program which was not designed
for R and uses printf().

I though on sink(...) before .C('f1'), but it doesn't work.
I call sink(file="res.txt") and only the Rprintf() are catched

Is there any way to however capture those printf() outputs ?

Thanks for any hint/pointer (... and i apologize
if i missed something obvious !).

Vincent

(for what may be worth, a "minimal" stuff is at www.khi.fr/IB/rp2)



[Rd] printf capture
mel