Advanced #Programming in the #UNIX Environment
`umask` and file modes explained in one slide
Advanced #Programming in the #UNIX Environment
`umask` and file modes explained in one slide
Advanced #Programming in the #UNIX Environment
Week 4, The Unix Filesystem
We begin a closer look at the Unix Filesystem (#UFS) and the Berkeley Fast Filesystem (FFS). We see how the filesystem structures the disk and organizes files and directories, visualize the concept of hard links, and observe how operations on a directory are independent of the files and their data.
Advanced #Programming in the #UNIX Environment
Week 3 bridge to week 4: Union Mounts and Whiteout Files
We describe the concept of union mounts and see what happens when a file in the upper layer is removed while the same file still exists in the lower layer: a whiteout file is created to cover up the lower file.
Advanced #Programming in the #UNIX Environment
Week 4, Directory Size
We dive deep into the structure of the directory on a traditional Unix File System and see how its size is independent of the file _sizes_ of its entries, but dependent on the _filename lengths_. We'll also use hexdump(1) to cheat a bit and look at the directory structure on disk. (This works on #NetBSD. #Linux doesn't let you read(2) a directory; you can use debugfs(8) there.)
Advanced #Programming in the #UNIX Environment
The #UFS File System (from the -- by now old -- "#Solaris Internals" book)
https://ptgmedia.pearsoncmg.com/images/0131482092/samplechapter/mcdougall_ch15.pdf
Advanced #Programming in the #UNIX Environment
Week 4, Directories
We take a look at how directories are created and removed, how to iterate directory entries using opendir(2), readdir(2) / getdents(2), and how to move around the filesystem hierarchy (with a quick hint of fts(3)). We also figure out why the 'cd' command must be a shell builtin in order to work, despite some systems providing a useless /usr/bin/cd (for some interpretation of #POSIX compliance).
Advanced #Programming in the #UNIX Environment
Week 4, Links
We'll take a look at the system calls used to create, remove, and rename both hard- and symbolic links and when disk blocks are actually free'd. We'll compare expected output against trivial implementations of the ln(1) and mv(1) commands.
Bobinas P4G is a social network. It runs on GNU social, version 2.0.1-beta0, available under the GNU Affero General Public License.
All Bobinas P4G content and data are available under the Creative Commons Attribution 3.0 license.