×
Namespaces

Variants
Actions

Archived:Open C重定向标准输入输出流

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

Article Metadata

兼容于
平台: S60 3rd Edition, S60 3rd Edition FP1 and FP2
S60 3rd Edition FP2
S60 3rd Edition FP1
S60 3rd Edition (initial release)

文章
翻译:
dougcn
最后由 hamishwillee 在 19 Jun 2012 编辑

Open C重定向标准输入输出流

描述

通过安装来自Open C发行中的可选包stdioserver.sis,就能创建一个用于调试目的的控制台(Console)。缺省情况下,stdout将被定向到这个控制台,stdin也从这里接收输入。

通过修改stdioserver的config.ini文件,就可以配置这些标准流的重定向。

解决办法

config.ini文件作为stdioserver.sis的组成部分而被安装。

在emulator上,它被安装到\epoc32\winscw\c\system\data目录; 在设备上,它被安装到c:\system\data目录。

样例config.ini文件演示如下。这里,stdin从控制台接受输入,stdout被重定向到串口(serial port)。此文件也含有用于从文件[MEDIA1]输入及输出到文件[MEDIA4]的区块(section),尽管本例中没有用到。

 [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
This page was last modified on 19 June 2012, at 07:51.
284 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×