lectures.alex.balgavy.eu

Lecture notes from university.
git clone git://git.alex.balgavy.eu/lectures.alex.balgavy.eu.git
Log | Files | Refs | Submodules

index.md (1300B)


      1 +++
      2 title = 'Files'
      3 +++
      4 # Files
      5 abstract storage 'devices' organised in (typically hierarchical) file system structure
      6 
      7 file access:
      8 
      9 - sequential (in order) vs. random access (e.g. second, then first, then third block)
     10 
     11 file types:
     12 
     13 - regular files, dirs, soft links
     14 - special files (e.g. device files, metadata files)
     15 
     16 file structure:
     17 
     18 - OS' perspective: files as streams of bytes
     19 - program's perspective: archives, executables, etc.
     20 - is OS ever aware of the file structure?
     21 
     22 file naming:
     23 
     24 - different file systems have different limitations/conventions for filenames
     25 - file extensions
     26 - file name length:
     27     - FAT: 8.3 characters (8 name, 3 extension. later extended to 255)
     28     - EXT4: 255 characters
     29 - Special chars in filenames:
     30     - FAT: no "\*/:<>?\| etc.
     31     - EXT4: no '\0' and '/' or special names '.' and '..'
     32 - case sensitivity depends
     33 
     34 file attributes:
     35 
     36 - there's a whole bunch of them
     37 
     38 ![](e803342509f8f738d741afcea618c4cc.png)
     39 file operations:
     40 
     41 - create/delete
     42 - open/close
     43 - read/write
     44 - append
     45 - seek
     46 - get attributes/set attributes
     47 - rename
     48 
     49 directories:
     50 
     51 - persistent data structures organising and maintaining info about files
     52 - file attrs stored in-band or out-of-band (both commonly used)
     53 
     54 ![](3830a931cb0e4b33017ef22e25f71c96.png)
     55 ![](7e47431605b7501bcca744b7f1330c8b.png)