annotate doc/posix-functions/open.texi @ 30163:6051c7c4c19f

Ensure that a filename ending in a slash cannot be used to access a non-directory.
author Bruno Haible <bruno@clisp.org>
date Wed, 24 Sep 2008 13:50:02 +0200
parents 97894444a902
children 541a421c693f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
29329
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 @node open
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2 @section @code{open}
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3 @findex open
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 POSIX specification: @url{http://www.opengroup.org/susv3xsh/open.html}
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 Gnulib module: open
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 Portability problems fixed by Gnulib:
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 @itemize
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 @item
29892
97894444a902 Work around open() bug on HP-UX 11 and Solaris 9.
Bruno Haible <bruno@clisp.org>
parents: 29329
diff changeset
12 This function does not fail when the file name argument ends in a slash
30163
6051c7c4c19f Ensure that a filename ending in a slash cannot be used to access a non-directory.
Bruno Haible <bruno@clisp.org>
parents: 29892
diff changeset
13 and (without the slash) names a nonexistent file or a file that is not a
6051c7c4c19f Ensure that a filename ending in a slash cannot be used to access a non-directory.
Bruno Haible <bruno@clisp.org>
parents: 29892
diff changeset
14 directory, on some platforms:
29892
97894444a902 Work around open() bug on HP-UX 11 and Solaris 9.
Bruno Haible <bruno@clisp.org>
parents: 29329
diff changeset
15 HP-UX 11.00, Solaris 9.
97894444a902 Work around open() bug on HP-UX 11 and Solaris 9.
Bruno Haible <bruno@clisp.org>
parents: 29329
diff changeset
16 @item
29329
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 On Windows platforms (excluding Cygwin), this function does usually not
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 recognize the @file{/dev/null} filename.
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 @end itemize
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 Portability problems not fixed by Gnulib:
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 @itemize
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 @item
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 On Windows, this function returns a file handle in @code{O_TEXT} mode by
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 default; this means that it translates '\n' to CR/LF by default. Use the
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 @code{O_BINARY} flag if you need reliable binary I/O.
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 @item
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 On platforms where @code{off_t} is a 32-bit type, @code{open} may not work
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 correctly with files larger than 2 GB. The fix is to use the
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 @code{AC_SYS_LARGEFILE} macro.
8cd0f07812b0 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 @end itemize