Lecture 023

File Operations

File: abstraction of persistent storage with logical grouping of data

Operation on Files:

We do two open() on the same file

We do two open() on the same file

File Structure

Program loader needs to know executables with magic number in first two bytes:

you can use file command to check the type of a data file

Access Methods

Sequential Access: read(), write() rewind() seek() Indexed Access: (for files contains records), index key to value

Directory Operations

Operations:

Hard link: instead of a tree, it's a DAG where we allow a file to own by multiple directories.

Soft link: symbolic link, short cut

Mounting: attach a file system to a directory, the directory becomes the root of the file system

User/Group: uid/gid, used for access control

Table of Content