55b333cc78cf0211b4a39ef53668ca15f88016b2
[gnulib.git] / doc / posix-functions / open.texi
1 @node open
2 @section @code{open}
3 @findex open
4
5 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/open.html}
6
7 Gnulib module: open, fchdir
8
9 Portability problems fixed by the Gnulib module open:
10 @itemize
11 @item
12 This function does not fail when the file name argument ends in a slash
13 and (without the slash) names a nonexistent file or a file that is not a
14 directory, on some platforms:
15 FreeBSD 7.2, AIX 7.1, HP-UX 11.00, Solaris 9, Irix 5.3.
16 @item
17 This function does not support the @code{O_NONBLOCK} flag when it is defined
18 by the gnulib module @code{nonblocking} on some platforms:
19 mingw.
20 @item
21 On Windows platforms (excluding Cygwin), this function does usually not
22 recognize the @file{/dev/null} filename.
23 @end itemize
24
25 Portability problems fixed by the Gnulib module fchdir:
26 @itemize
27 @item
28 On Windows platforms (excluding Cygwin), this function fails to open a
29 read-only descriptor for directories.
30 @end itemize
31
32 Portability problems not fixed by Gnulib:
33 @itemize
34 @item
35 On Windows, this function returns a file handle in @code{O_TEXT} mode by
36 default; this means that it translates '\n' to CR/LF by default.  Use the
37 @code{O_BINARY} flag if you need reliable binary I/O.
38 @item
39 On platforms where @code{off_t} is a 32-bit type, @code{open} may not work
40 correctly with files larger than 2 GB.  The fix is to use the
41 @code{AC_SYS_LARGEFILE} macro.
42 @end itemize