4.5. Traversing Directory Trees

Directory traversal is a very common activity in many different types of applications, and there are a number of good reasons to use this capability. For example, you might need to accomplish any of the following tasks:

  1. Delete a directory and any subdirectories within it

  2. Search a drive for the biggest file or 100 biggest files

  3. Get all of the file names held in a directory so that you can back them up to tape

  4. Search for a file or group of files anywhere on a drive

  5. Search through directories to find .obj or .tmp files to delete, to free disk space

  6. Find the total disk space consumed by a directory tree

  7. Search for a specific word in any .txt file you find on a drive

  8. Display the directory tree for a drive as a graphic

  9. Check ...

Get Win32 System Services: The Heart of Windows® 98 and Windows® 2000 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.