Files and Directories Flashcards
(73 cards)
Secondary Storage Systems include _______ disks, ____, and tapes
magnetic, SSDs
Storing bits on ______ is different from storing them on flash
disk
The OS provides a ______ view of storage to users
uniform
The OS creates file _______ on storage media
systems
File systems ________ store and retrieve data
efficiently
File systems enable ______ view of data via files and __________
logical, directories
A file is a linear array of _____
bytes
Files persistently record user-defined information on ________
storage
What is the inode number?
The low-level name that internally identifies a file
What are example of operation on files?
- Open
- Close
- Read
- Write
- Reposition
- Delete
- Truncate
More complex operations on files can be made using ________ operations
primitive
In the POSIX file interface, what function do you use to create/open a file?
open(name, arg)
In the POSIX file interface, what does open() return?
A file descriptor used for accessing files
In the POSIX file interface, what do the arguments O_CREAT, O_WRONLY. and O_TRUNC do in open()?
O_CREAT - create new file
O_WRONLY - only write to the file
O_TRUNC - remove any existing content in the file
In the POSIX file interface, how do you close a file?
close(file descriptor)
In the POSIX file interface, how do you rename a file?
rename(char *old, char *new)
In the POSIX file interface, how do you delete a file?
unlink(char *name)
In the POSIX file interface, how do you read files?
read(file descriptor, buffer pointer, the size of the buffer)
In the POSIX file interface, how do you write to files?
write(file descriptor, buffer pointer, the size of the buffer)
In the POSIX file interface, what does read() return?
Number of bytes read
In the POSIX file interface, what does write() return?
Number of bytes written
In the POSIX file interface, you should repeat multiple _______ calls for larger files
write()
In the POSIX file interface, each open file has a _______ offset
current
In the POSIX file interface, the current offset determines _____ the next read or write will begin from the file
where