The CUPS file and directory APIs provide portable interfaces for manipulating files and listing files and directories. Unlike stdio FILE streams, the cupsFile functions allow you to open more than 256 files at any given time. They also manage the platform-specific details of locking, large file support, line endings (CR, LF, or CR LF), and reading and writing files using Flate ("gzip") compression. Finally, you can also connect, read from, and write to network connections using the cupsFile functions.

The cupsDir functions manage the platform-specific details of directory access/listing and provide a convenient way to get both a list of files and the information (permissions, size, timestamp, etc.) for each of those files.