Hands-On System Programming with C++
上QQ阅读APP看书,第一时间看更新

Filesystems

POSIX not only defines how to read and write a file from a POSIX-compliant operating system, it also defines where files should be located on the filesystem. In Chapter 8, Learning to Program File Input/Output, we will go into great detail about how to read and write to a filesystem using C, C++, and POSIX. 

With respect to the layout of the filesystem, POSIX defines where files should be located, including common folders such as the following:

  • /bin: for binaries used by all users
  • /boot: for files needed to boot the operating system
  • /dev: for physical and virtual devices
  • /etc: for configuration files needed by the operating system
  • /home: for user-specific files
  • /lib: for libraries needed by executables
  • /mnt and /media: used as temporary mount points
  • /sbin: for system-specific binaries
  • /tmp: for files that are deleted on reboot
  • /usr: for user-specific versions of the preceding folders