[Rd] File and console output does not work in C code

Benjamin Leblanc benjamin.leblanc at igh.cnrs.fr
Wed Jan 28 17:46:13 CET 2009

Hello all,
I am getting into trouble when trying to do standard I/O from a C 
function called within R environment.

This function is written in a small C library that is loaded whith 
dyn.load() and called in R via the .C() interface. I need to debug the C 
code using a text file for some logs, and also to speed up its result 
visualization by creating images on the fly using the GD library.
Both of these outputs require to write into files from this C function.
Allthough everything goes smoothly from compilation and linking to 
execution into R without errors, no file is created. I have also tried 
to do some simple printf(), Rprintf() and REprintf() but even that 
didn't gave me any visible output.

Am I missing something trivial? Could anyone give me a hint on why it 
does not work?
Best regards,


Chromatin and Cell Biology Lab.
Institute for Human Genetics
141, rue de la Cardonille
F-34396 Montpellier
Phone  +33-(0)4 99 61 99 51
FAX      +33-(0)4 99 61 99 01

More information about the R-devel mailing list