File System API

File System

File

Types of Names

  1. UID (Unique ID); called inode numbers in Unix/Linux
    • Each file has its own inode number
    • Files deleted will have their inode number recycled
    • Only has to be unique for a given file system
    • Can see inode numbers by running: ls -i
    • 1% of storage is inodes
  2. Path Name
  3. File Descriptor

inode Structure

Paths

mkdir: gets a new inode and creates an empty file for the directory

File Descriptor (FD)

Deleting Files

mount

fsync

mv: rename a file

Atomic File Update

  1. Make a temporary file
  2. Rename the temporary file