NAME

open - open a file, pipe, or descriptor


SYNOPSIS

open


DESCRIPTION

Open a file for reading for writing. This returns file descriptors, not Perl filehandles. Use POSIX::close to close the file.

Open a file read-only with mode 0666.

	$fd = POSIX::open( "foo" );

Open a file for read and write.

	$fd = POSIX::open( "foo", &POSIX::O_RDWR );

Open a file for write, with truncation.

	$fd = POSIX::open( "foo", &POSIX::O_WRONLY | &POSIX::O_TRUNC );

Create a new file with mode 0640. Set up the file for writing.

	$fd = POSIX::open( "foo", &POSIX::O_CREAT | &POSIX::O_WRONLY, 0640 );

Returns undef on failure.