![]() |
CITS2002 Systems Programming |
← prev | next → | ![]() |
![]() |
|||
Finding the attributes of a fileAs seen in Lecture-15, many operating systems manage their data in a file system, in particular maintaining files in a hierarchical directory structure - directories contain files and other (sub)directories.As we saw with time-based information, we may request file- and directory information from the operating system by calling system-calls. We may employ another POSIX† function, stat(), and the system-provided structure struct stat, to determine the attributes of each file:
†POSIX
is an acronym for "Portable Operating System Interface", a family of
standards specified by the IEEE for maintaining compatibility between
operating systems.
POSIX defines the application programming interface
(API), along with command line shells and utility interfaces, for software
compatibility with variants of Unix (such as macOS and Linux)
and other operating systems (e.g. Windows has a POSIX emulation layer).
CITS2002 Systems Programming, Lecture 16, p5, 19th September 2023.
|