Redirect standard I/O to a file
This example illustrates how to redirect standard I/O to a file. The libc library provides freopen() API to redirect all standard IOs (namely - stderr, stdin or stdout). Application first prints launching information at the console and then opens one file to redirect standard output using freopen() . Calling freopen() once more, the user can change the filename during execution. This helps to redirect application printf() messages into a log file.
Click on the following link to download the example: redirectprintf.zip
Click: browse to view the example code.
The following sections provide information about the implementation of the example.
Capabilities
The program capabilities are defined in redirectprintf.mmp : CAPABILITY NONE .The application is simple console based application. It has its own default icon and can be launched from the UI both in the emulator and in the device. The application can be launched by: Executing redirectprintf from eshell. Clicking default icon with display text redirectprintf within the install folder launcher application.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.