FD_Type open (String_Type filename, Int_Type flags [,Int_Type mode])
The open function attempts to open a file specified by the
filename parameter according to the flags parameter,
which must be one of the following values:
O_RDONLY (read-only)
O_WRONLY (write-only)
O_RDWR (read/write)
In addition, flags may also be bitwise-or'd with any of the
following:
O_BINARY (open the file in binary mode)
O_TEXT (open the file in text mode)
O_CREAT (create file if it does not exist)
O_EXCL (fail if the file already exists)
O_NOCTTY (do not make the device the controlling terminal)
O_TRUNC (truncate the file if it exists)
O_APPEND (open the file in append mode)
O_NONBLOCK (open the file in non-blocking mode)
Some of these flags only make sense when combined with other flags.
For example, if O_EXCL is used, then O_CREAT must also be
specified, otherwise unpredictable behavior may result.
If O_CREAT is used for the flags parameter then the
mode parameter must be present. mode specifies the
permissions to use if a new file is created. The actual file
permissions will be affected by the process's umask via
mode&~umask. The mode parameter's value is
constructed via bitwise-or of the following values:
S_IRWXU (Owner has read/write/execute permission)
S_IRUSR (Owner has read permission)
S_IWUSR (Owner has write permission)
S_IXUSR (Owner has execute permission)
S_IRWXG (Group has read/write/execute permission)
S_IRGRP (Group has read permission)
S_IWGRP (Group has write permission)
S_IXGRP (Group has execute permission)
S_IRWXO (Others have read/write/execute permission)
S_IROTH (Others have read permission)
S_IWOTH (Others have write permission)
S_IXOTH (Others have execute permission)
Upon success open returns a file descriptor object
(FD_Type), otherwise NULL is returned and errno
is set.
If you are not familiar with the open system call, then it
is recommended that you use fopen instead.
- slangrtl
-
chdir,
chmod,
chown,
clearerr,
close,
dup_fd,
fclose,
fdopen,
feof,
ferror,
fflush,
fgets,
fgetslines,
fileno,
fopen,
fputs,
fread,
fseek,
ftell,
fwrite,
isatty,
listdir,
lseek,
lstat_file,
mkdir,
mkfifo,
popen,
read,
readlink,
stat_file,
stat_is,
umask,
write
|