open#
Open a file by path, returning a raw file descriptor.
Σύνοψη#
use POSIX qw(open O_RDONLY O_CREAT O_WRONLY);
my $fd = open($path, O_RDONLY)
or die "open: $!";
Τι επιστρέφεται#
A non-negative integer fd on success, undef on failure (with $! set). This is the raw system fd, not a Perl filehandle - pair it with POSIX::close or convert via IO::Handle::fdopen.
Διαφορές από το upstream#
Fully compatible with upstream POSIX. Third argument $mode defaults to 0666 when opening with O_CREAT and no mode given.
Δείτε επίσης#
close,dup,lseek,read,write- the rest of the raw fd API.Core
open- the Perl-native filehandle interface.