File Management
A user can perform the following activities with files:
- Creating new files.
- Writing to (changing) the content of an existing file, such as by replacing some of the existing content [= "overwritting"] or appending new data to the end of the existing content.
- Reading (accessing) the content of an existing file.
- Repositioning within a file. That is, when a file is open by a program, the program can instruct the OS to put the reading or writing position at a particular place in the file. For instance, the program can issue an instruction to start reading the file at position 1000 (which is 999 bytes into the file since byte 0 is the 1st byte.)
- Deleting a file if one isn't needed anymore.
- Truncating a file, which is cutting off (discarding) some of the file's content. For example, we could discard (delete) all the content from byte 1001 and onward, and only to keep the first 1000 bytes in the file.