HP-UX Reference (11i v1 05/09) - 3 Library Functions A-M (vol 6)

f
fopen(3S) fopen(3S)
[ENOMEM] There is insufficient space to allocate a buffer.
fopen() and freopen() fail if:
[EACCES] Search permission is denied on a component of the path prefix, or the file exists and the
permissions specified by type are denied, or the file does not exist and write permission is
denied for the parent directory of the file to be created.
[EINTR] A signal was caught during fopen()
or freopen(). function.
[EISDIR] The named file is a directory and type requires write access.
[EMFILE] The calling process has attempted to exceed its open file limit.
[ENAMETOOLONG]
The length of the pathname string exceeds PATH_MAX
or a pathname component is longer
than
NAME_MAX while POSIX_NO_TRUNC
is in effect.
[ENFILE] The system file table is full.
[ENOENT] The named file does not exist or the pathname argument points to an empty string.
[ENOSPC] The directory or le system that would contain the new file cannot be expanded, the file
does not exist, and it was to be created.
[ENOTDIR] A component of the path prefix is not a directory.
[ENXIO] The named file is a character special or block special file, and the device associated with the
special file does not exist.
[EOVERFLOW] The named file is a regular file and the size of the file cannot be represented correctly in an
object of size off_t in this environment.
[EROFS] The named file resides on a read-only file system and type requires write access.
Additional
errno values can be set by the underlying open() call made from the fopen() and freo-
pen()
functions (see open(2)).
NOTES
HP-UX binary file types are equivalent to their non-binary counterparts. For example, types
r and rb are
equivalent.
SEE ALSO
creat(2), dup(2), open(2), pipe(2), fclose(3S), fgetpos64(3S), fseek(3S), popen(3S), setbuf(3S), orientation(5),
thread_safety(5).
STANDARDS CONFORMANCE
fopen(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, ANSI C
fdopen(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1
freopen(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, ANSI C
HP-UX 11i Version 1: September 2005 2 Hewlett-Packard Company Section 3277