An NDBM Database Example

An example of a small application employing a NDBM database is presented in the upcoming listings. The purpose of the application is to tree walk one or more directory names, calling lstat(2) on each file system object. Then the lstat(2) information is stored in the snapshot database and indexed by the device number and i-node number. The application has been named SnapShot.

Once a snapshot has been taken, it is possible to invoke the application again with different command-line options. With the -c option provided, the SnapShot program will then walk the named directories, comparing each file system's lstat(2) information to what is stored in the database. Any differences are then reported. This provides similar functionality ...

Get Advanced UNIX Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.