Linux中没有O_BINARY和O_TEXT标志? [英] No O_BINARY and O_TEXT flags in Linux?
问题描述
O_RDONLY
和 O_RDWR
标志,但它不知道 O_BINARY
和 O_TEXT
标志的含义。 这是一个Linux的东西吗?
不管怎样,不区分二进制和文本文件。因此,这个名字没有标准常量。你可以在Linux中手动定义常量为零,如果你想将它们包含在你的代码中以实现可移植性的话。
$ b
http://unix.derkeiler.com/Newsgroups/comp.unix.programmer/2007-03/msg00147。 html
When using system-level IO in Linux, I noticed that the compiler recognized the O_RDONLY
and O_RDWR
flags, but it had no clue whatsoever as to the meaning of the O_BINARY
and O_TEXT
flags.
Is this a Linux thing?
Linux, and just about every flavor of Unix for that matter, doesn't differentiate between binary and text files. Thus, there are no standard constants with that name. You can manually define the constants to be zero in Linux if you want to include them in your code for portability purposes.
http://unix.derkeiler.com/Newsgroups/comp.unix.programmer/2007-03/msg00147.html
这篇关于Linux中没有O_BINARY和O_TEXT标志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!