How do I search directories using Irie Pascal?
Answer. In Irie Pascal directories are just lists of filenames (I am using the term list in the general sense, I’m not referring to the special list type defined in the Irie Pascal programming language). Most operating systems don’t allow you to manipulate directories using the file procedures, so Irie Pascal provides a separate group of procedures for manipulating directories. These procedures are “opendir”, “readdir”, “rewinddir”, and “closedir”. Before you can use a directory you have to open it using “opendir”. Once a directory is opened, you can use “readdir” to read the name of a file in the directory (starting with the first file). Each time you use “readdir” it advances to the next file. “rewinddir” moves back to the first file. When you have finished reading the directory you should close it using “closedir”. The sample program “listdir.pas” is a simple program that shows how to use most of the built-in directory procedures. Take a look at “listdir.pas” (in the samples directo