Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
12 Cards in this Set
- Front
- Back
File Descriptor
|
A usually small nonnegative integer used to refer to all types of open files.
|
|
What are the three standard file descriptors?
|
0 - standard input (stdin)
1 - standard output (stdout) 2 - standard error (stderr) |
|
open(pathname, flags, mode)
|
Opens the file identified by pathname, returning a file descriptor used to refer to the open file in subsequent calls.
|
|
Flags
|
An argument that specifies whether the file is to be opened for reading, writing, or both.
|
|
Mode
|
An argument that specifies the permissions to be placed on the file if it is created by this call.
|
|
read(rd, buffer, count)
|
Reads at most count bytes from the open file referred to by fd and stores them in buffer.
|
|
write(fd, buffer, count)
|
Writes up to count bytes from buffer to the open file referred to by fd.
|
|
close(fd)
|
Called after all I/O has been completed, in order to release the file descriptor fd and its associated kernel resources.
|
|
File Access Mode Flags
|
These are the O_RDONLY, O_WRONLY, and O_RDWR flags. They can be retrieved using the fcntl() operation.
|
|
File Creation Flags
|
These flags control various aspects of the behavior of the open() call, as well as options for subsequent I/O operations. These flags can't be retrieved or changed.
|
|
Open File Status Flags
|
These are the remaining flags. They can be retrieved and modified using the fcntl() operations.
|
|
creat()
|
System call creates and opens a new file with the given pathname, or if the file already exists, opens the file and truncates it to zero length.
|