HH\Lib\OS\open
Open the specified path
namespace HH\Lib\OS;
function open(
string $path,
int $flags,
?int $mode = NULL,
): FileDescriptor;
See man 2 open
for details. On error, an ErrnoException
will be thrown.
Parameters
string $path
int $flags
a bitmask ofO_
flags; one out ofO_RDONLY
,O_WRONLY
, andO_RDWR
must be specified.O_CLOEXEC
is implicit, so that standalone CLI mode is consistent with server modes. If needed, this can be removed withOS\fcntl()
.?int $mode = NULL
specify the mode of the file to create ifO_CREAT
is specified and the file does not exist.