O'Reilly logo

Beginning, Mac OS® X Snow Leopard™ Programming by Drew McCormack, Michael Trent

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

Appendix A. Answers to Exercises

Exercise 1 Solution

The first two apropos commands return far too much information to be useful. The third command, apropos "copy file" returns a reasonable amount of information.

Macintosh:~ sample$ apropos "copy file"
CpMac(1), /usr/bin/CpMac(1) - copy files preserving metadata and forks
File::Copy(3pm)          - Copy files or filehandles
cp(1)                    - copy files
cpio(1)                  - copy files to and from archives

From this result, you might surmise that CpMac, cp, or cpio would be an appropriate tool for copying files. Of course, the manual entry for each command provides more helpful information.

Exercise 2 Solution

The command man -k "copy file" is equivalent to apropos "copy file" and yields the same results as Exercise 1.

Exercise 1 Solution

Use the following steps to collect the sample:

  1. Launch /Developer/Applications/Instruments. The program starts and displays a list of available templates.

  2. Choose the Time Profiler template. Instruments configures your document with the Time Profiler instrument.

  3. Click the Record button in the toolbar. This brings up an open panel where you can specify which program you want to start along with other options.

  4. Select /Applications/Stickies in the Open panel and click the Choose button. The Stickies application appears in the Dock, and the Dock's windows appear behind the Instruments application.

  5. Switch to Stickies and use the application. Type some notes, change the color a few times, and do the usual things you do with Stickies. ...

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