Name
sysopen
Synopsis
sysopen filehandle, filename, mode, [perms]
Opens the file given by
filename and associates it with
filehandle. This function calls
open(2) with the parameters
filename,
mode, and
perms.
The possible values and flag bits of the
mode parameter are system-dependent;
they are available via the Fcntl library module. However, for
historical reasons, some values are universal: 0 means read-only, 1 means write-only, and 2 means read/write.
If the file named by filename
does not exist, and sysopen
creates it (typically because mode
includes the O_CREAT flag),
then the value of perms specifies the
permissions of the newly created file. If
perms is omitted, the default value is
0666, which allows read and
write for all. This default is reasonable. See umask .
The FileHandle module provides a more object-oriented
approach to sysopen. See also
open .
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access