File Types and Structure

File type 告訴 OS 或 application 這個 file 應該如何解讀。Type 可能來自 extension、magic number、metadata attribute,或 directory entry。

常見 file types:

  • regular file
  • directory
  • executable
  • symbolic link
  • device special file

File structure 則是 file 內部資料的組織方式。UNIX-like systems 通常把 regular file 視為 byte stream;record、line、image、database page 等意義多由 application 解讀。