Приглашаем посетить
Отели (hotels.otpusk-info.ru)

[Chapter 12] 12.6 Exercises

PreviousChapter 12
Directory Access
Next
 

12.6 Exercises

Answers are in Appendix A, Exercise Answers.

  1. Write a program to change directory to a location specified as input, then list the names of the files in alphabetical order after changing there. (Don't show a list if the directory change did not succeed: merely warn the user.)

  2. Modify the program to include all files, not just the ones that don't begin with dot. Try to do this with both a glob and a directory handle.


PreviousHomeNext
12.5 Reading a Directory HandleBook Index13. File and Directory Manipulation