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 $pathint $flagsa bitmask ofO_flags; one out ofO_RDONLY,O_WRONLY, andO_RDWRmust be specified.O_CLOEXECis implicit, so that standalone CLI mode is consistent with server modes. If needed, this can be removed withOS\fcntl().?int $mode = NULLspecify the mode of the file to create ifO_CREATis specified and the file does not exist.