C-FAQ 19.7 [英] C-FAQ 19.7

查看:64
本文介绍了C-FAQ 19.7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这就是现在的情况(2006年12月20日)


如何进行串口(``comm'''')端口I / O?


这是系统依赖的。在Unix下,您通常在/ dev中打开,读取和写入

设备文件,并使用终端驱动程序的设施来调整其特性。 (另见问题19.1和19.2。)在

MS-DOS下,你可以使用预定义的流stdaux,或者像

COM1这样的特殊文件,或者一些原始的BIOS中断或者(如果你需要不错的性能)b / b
性能)任意数量的中断驱动的串行I / O包。几个

netters推荐由Joe Campbell撰写的C Programmer's Series to Serial

Communications。


--- ------------


我会删除所有对MSDOS的引用,这个系统因为十多年来已经过时了b $ b现在。


建议的替换文本如下:


这是系统相关的。在Unix下,您通常在/ dev中打开,读取和写入

设备文件,并使用终端驱动程序的设施来调整其特性。 (另请参阅问题19.1和19.2。)


在windows(Win32)下,您可以使用原语CreateFile,ReadFile,

和WriteFile来打开串行通信端口,读/写

到/从它。有关详细信息,请参阅:

http://msdn.microsoft.com/library/de...sdn_serial.asp

This is what is there now (2006, 20 Dec)

How can I do serial (``comm'''') port I/O?

It''s system-dependent. Under Unix, you typically open, read, and write a
device file in /dev, and use the facilities of the terminal driver to
adjust its characteristics. (See also questions 19.1 and 19.2.) Under
MS-DOS, you can use the predefined stream stdaux, or a special file like
COM1, or some primitive BIOS interrupts, or (if you require decent
performance) any number of interrupt-driven serial I/O packages. Several
netters recommend the book C Programmer''s Guide to Serial
Communications, by Joe Campbell.

---------------

I would eliminate all references to MSDOS, a system that
is obsolete since more than a decade now.

The proposed replacement text is below:

It''s system-dependent. Under Unix, you typically open, read, and write a
device file in /dev, and use the facilities of the terminal driver to
adjust its characteristics. (See also questions 19.1 and 19.2.)

Under windows (Win32) you can use the primitives CreateFile, ReadFile,
and WriteFile to open a serial communications port, and read/write
to/from it. For more information see:

http://msdn.microsoft.com/library/de...sdn_serial.asp

推荐答案

jacob navia说:


[C FAQ 19.7]
jacob navia said:

[C FAQ 19.7]

我将删除所有对MSDOS的引用,自从十多年以来,b $ b系统已经过时了。
I would eliminate all references to MSDOS, a system that
is obsolete since more than a decade now.



尽管如此,它仍然被使用,即使是学习C的人。我看到没有任何好处

删除文本。

Nevertheless, it is still used, even by people learning C. I see no benefit
to removing the text.


建议的替换文本如下:
The proposed replacement text is below:



< snip>

<snip>


在windows(Win32)下你可以使用原语CreateFile,ReadFile,

和WriteFile打开一个串口通讯端口,并读/写

到/从中。有关更多信息,请参阅:
Under windows (Win32) you can use the primitives CreateFile, ReadFile,
and WriteFile to open a serial communications port, and read/write
to/from it. For more information see:



但是,添加对Windows技术的引用是合理的,因为你需要b $ b建议。 />

-

Richard Heathfield

Usenet是一个奇怪的地方 - dmr 29/7/1999
http://www.cpax.org.uk

电子邮件:rjh在上述域名中, - www。

It is, however, reasonable to add a reference to a Windows technique, as you
suggest.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.


2006年12月21日星期四13:33:15 + 0100,在comp.lang.c,jacob navia

< ja *** @ jacob.remcomp.frwrote:
On Thu, 21 Dec 2006 13:33:15 +0100, in comp.lang.c , jacob navia
<ja***@jacob.remcomp.frwrote:

>
我会删除所有对MSDOS的引用,这个系统已经过了十多年就已经过时了。
>
I would eliminate all references to MSDOS, a system that
is obsolete since more than a decade now.



嗯,是的,但是Windows 95也是如此,而且有很多用户使用

。可能还有很多DOS用户。


-

马克麦金太尔


"调试是两次和编写代码一样困难。

因此,如果你尽可能巧妙地编写代码,那么,根据定义,你是b $ b,不够聪明,无法调试它。

--Brian Kernighan

Well, yes, but so has Windows 95 and there are plenty of users of
that. There are probably still plenty of DOS users.

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan


jacob navia写道:
jacob navia wrote:

这就是现在的情况(2006年12月20日)

[...]

我将删除对MSDOS的所有引用,这是一个系统,即

已经过时十多年了。

[...]
This is what is there now (2006, 20 Dec)
[...]
I would eliminate all references to MSDOS, a system that
is obsolete since more than a decade now.
[...]



为什么要打扰comp.lang.c物?常见问题解答对Steve Summit来说属于
;把你的建议带给他。


-

Eric Sosman
es ***** @ acm-dot-org.inva 盖子


这篇关于C-FAQ 19.7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆