# Archived:Redirecting stdin and stdout streams in Open C

Compatibility
Platform(s): S60 3rd Edition
S60 3rd Edition, FP1 and FP2
S60 3rd Edition FP2
S60 3rd Edition FP1
S60 3rd Edition (initial release)
Article
Created: User:Technical writer 1 (12 Jun 2008)
Last edited: hamishwillee (14 Sep 2012)

## Description

By installing the optional stdioserver.sis package from Open C deliverables, a console for debugging purposes will be created. By default, stdout will be directed to this console and stdin will also take its input from it.

It is possible to configure the redirection of these standard streams by modifying the stdioserver's config.ini file.

## Solution

config.ini is installed as part of the stdioserver.sis package.

In the emulator, it is installed in \epoc32\winscw\c\system\data.
In the device, it is installed in c:\system\data.

A sample config.ini is shown below. Here, stdin input is taken from a console and stdout is redirected to a serial port. The file also contains sections for input from a file [MEDIA1] and output to a file [MEDIA4], although they are not used in this case.

 [STDIO]
STDIN = MEDIA3
STDOUT = MEDIA2

[MEDIA1]
type = file
path = C:\system\data\in.txt
max size = 100

[MEDIA2]
type = serial
baud = 214
port = COMM::10

[MEDIA3]
type = console
width = -1
height = -1

[MEDIA4]
type = file
path = c:\system\data\out.txt
max size = 1000