S60 Open C
Examples for Open C Libraries

Examples for Open C Libraries

Table of Contents

Redirect printf
MMP File for Redirect printf
Source Code for Redirect printf

 


Redirect printf

This example illustrates how to redirect stdio to a file. libc library provides freopen API to redirect all standard IOs (namely, stderr, stdin, or stdout). Application first printf launching information at console and then open one file to redirect stdout using freopen. Calling freopen once more, user can change the filename during execution. This helps to redirect application printf messages into a log file.

 


MMP File for Redirect printf

TARGET        	redirectprintf.exe
TARGETTYPE    	exe
UID           		0 0xA0001F1C 
CAPABILITY      	NONE
VENDORID        	0
SOURCEPATH      ..\data
START RESOURCE  redirectprintf_reg.rss
#ifdef WINSCW
TARGETPATH 	    \private\10003a3f\apps
#else
TARGETPATH 	    \private\10003a3f\import\apps
#endif
END //RESOURCE

SOURCEPATH    ..\src
SOURCE        redirectprintf.c
USERINCLUDE   ..\inc
SYSTEMINCLUDE \Epoc32\include
SYSTEMINCLUDE 	\epoc32\include\stdapis
STATICLIBRARY	libcrt0.lib
LIBRARY		libc.lib
LIBRARY		libpthread.lib
LIBRARY		euser.lib

 


Source Code for Redirect printf

Go to this location \nokia_plugin\openc\s60opencex\opencredirectprintf to view the source code for this example.

NOTE: This code has been tested on Carbide.

Give feedback of this article


Back to top

Copyright ©2008 Nokia Corporation. All rights reserved. This documentation can be used in the connection with this Product to help and support the user.