Querying Filesystem Usage
Given the methods of controlling filesystem usage we’ve just explored, it is only natural to want to keep track of how well they work. To end this chapter, let’s look at a method for querying the filesystem usage on each of the operating systems found in this book.
MacOS is the operating system for which this
task is hardest. MacOS does have a Macintosh Toolbox routine
(PBHGetVInfo) to retrieve volume information,
but at the current time there is no MacPerl module available to make
calling this function easy. Instead, we have to take a roundabout
approach and ask the Finder to query this
information for us. This is easy in practice thanks to a glue module,
but the setup needed for this method makes MacOS the more difficult
operating system to deal with.
All the materials for the following involve work by Chris Nandor and can be found at http://pudge.net or on CPAN. Bear with me as we go over this setup step by step:
Install the cpan-mac bundle. cpan-mac includes the
CPAN.pmmodule by Andreas J. König and other handy modules we mentioned in Chapter 1. Even if you don’t want to query filesystem usage from MacOS, you’ll still be well served by installing this bundle. When you install this bundle, be sure to follow all of the directions found in theREADMEfile.Install the latest
Mac::AppleEvents::Simplemodule by dropping the distribution file on top of the installme droplet.Install the
Mac::Gluemodule. The installme droplet decompresses and unpacks the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access