文件的10个关键系统调用

  • open/close
  • read/write/lseek(随机查找)
  • fstst(返回文件数据)/ftruncate(清空)
  • unlink(删除文件)/mkdir / dup

文件系统的抽象

struct File {
	mode (permissions, type); size; user; group;//type数据结构的类型
	timestamps(atime, mtime,ctime);
	content (bytes);
};

map <string, File> // from file path to file 一种数据结构, 从路径到文件的映射