The UNIX File System

Last time: Users and Files: cp, ls, and tail

Prof. Brian D. Davison

Computer Science & Engineering, Lehigh University

Today

Reading Directories

Using Directory Functions

Writing first version of ls.c

main()
    opendir()
    while ( readdir() )
       print d_name

    closedir()
    return 0

Hard drive organization

Hard drive organization

A logical block may actually consist of multiple disk sectors.

Hard drive organization

Creating a file

Creating a file

Creating a file

Reading a file

Large files

Files in Directories

Thought Questions:

Relevant system calls

pwd

Multiple File Systems