-
Book Overview & Buying
-
Table Of Contents
Systems Programming with Zig
By :
Modern Systems Programming demands a delicate balance between high-level abstraction and granular control over hardware resources, a philosophy that lies at the heart of the Zig programming language. Zig provides the primitives necessary to interact directly with the underlying data structures and event notifications of the operating system. This chapter explores the mechanics of navigating directories and managing files, moving beyond basic I/O to address the technical realities of modern filesystems. We will begin by implementing basic tasks before constructing a directory tree visualizer, ztree, which requires an understanding of recursive traversal and the handling of edge cases like cyclic symbolic links. From there, the focus shifts to real-time interaction through zwatch, a file-monitoring utility that leverages platform-specific primitives such as Linux inotify or BSD kqueue. Finally, the chapter concludes with the implementation...