HP-UX Reference (11i v2 07/12) - 2 System Calls (vol 5)

o
open(2) open(2)
int infd;
infd = open ("inputfile", O_RDONLY);
The following call to open() opens file
outputfile for writing and returns a file descriptor for out-
putfile
. For an example of preallocating disk space for
outputfile
, see the prealloc(2) manual
entry. For an example of writing to
outputfile , see the write(2) manual entry.
int outfd;
outfd = open ("outputfile", O_WRONLY);
The following call opens file iofile
for synchronized I/O file integrity for reads and writes.
int iofd;
iofd = open ("iofile", O_RDWR|O_SYNC|O_RSYNC);
AUTHOR
open() was developed by HP, AT&T, and the University of California, Berkeley.
SEE ALSO
acl(2), chmod(2), close(2), creat(2), dup(2), fcntl(2), lockf(2), lseek(2), creat64(2), pathconf(2), read(2),
select(2), umask(2), write(2), setacl(2), acl(5), aclv(5), fcntl(5), signal(5), thread_safety(5), unistd(5).
STANDARDS CONFORMANCE
open(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, POSIX.4
244 Hewlett-Packard Company 4 HP-UX 11i Version 2: December 2007 Update