O'Reilly logo

Advanced UNIX Programming by Warren W. Gay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required