Categories
c file

No O_BINARY and O_TEXT flags in Linux?

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