FD_OPEN(3H) — Pixar Programmer’s Manual — libfd
NAME
fd_open − open a fast-disk file for reading and/or writing
SYNOPSIS
fd_open(path, mode)
char ∗path;
int mode;
DESCRIPTION
Fd_open opens the Fast-Disk file path for reading and/or writing and returns a descriptor for that file. The flags argument specifies the type of access desired:
0 read-only
1 write-only
2 read and write
Path is the address of a string of ASCII characters representing a Fast-Disk path name, terminated by a NUL character.
Upon successful completion a non-negative integer termed a file descriptor is returned. The file pointer used to mark the current position within the file is set to the beginning of the file.
ERRORS
If the named file cannot be opened, fd_open returns -1 and the global variable errno contains one of the following codes:
[ENOTDIR] A component of the path prefix is not a directory.
[ENOENT] A component of the path name that must exist does not exist.
[EISDIR] The specified file is a directory. The only permissible technique for reading the contents of a directory is fd_readdir.
[EROFS] Path resides in a read-only Fast-Disk filesystem, and mode is either 1 or 2.
[EMFILE] All Fast-Disk file descriptors available to the calling process are in use.
[EINVAL] The mode argument was not 0, 1, or 2.
[EIO] A disk I/O error occurred.
[ENOMEM] Insufficient memory was available in the user’s process to allocate necessary resources for the open.
SEE ALSO
fd_close(3H), fd_lseek(3H), fd_read(3H), fd_write(3H), fd(5)
Release β — Last change: 10/12/88