secondary storage
backs up main memory
usually a disk
file systems provide
a mechanism for storage of data and programs on the disk and accessing them
files are mapped by OS to physical address
different storage devices
essential requirements for long-term information storage
file system
file system flow
user program syscall -> virtual fs -> page cache -> fs driver (FAT, NFTS…) -> buffer cache ->storage
files
file types
regular: directories, soft links
special: device files, metadata…
file structure
OS perspective: files as streams of bytes
program’s perspective: archives, executables, etc.
file naming
extensions
name length
case sensitivity
once a file is named it becomes independent
file types
executable file
exe, com, bin or none
ready-to-run machine language program
object
obj, o
compiled machine language, not linked
source code
c, cpp, java, py
j
batch
bat, sh
commands to the command interpreter
text
txt, doc
word processor
wp, doc, rtf
library
lib, a
libraries f routines for programmes
print or view
ps, pdf, jpg
ASCII or binary in a format for printing or viewing
archive
arc, zip, tar
related files grouped into one file sometimes compressed for archiving and storage
multmedia
mp3,m mp4, avi
binary file containing audio or A/V info
MAC OS X file identification
each file has a type specified with it to identify its type
UNIX file identification
magic number stored at the beginning of some files to indicate the type
file attributes
name: human readable
identifier
type
location
size
creation date
last modified
…