Directory Reading Routines

closedir(DIRHANDLE)
closedir DIRHANDLE
Closes a directory opened by opendir().

opendir(DIRHANDLE,EXPR)
Opens a directory named EXPR for processing by readdir(), telldir(), seekdir(), rewinddir() and closedir(). Returns true if successful. DIRHANDLEs have their own namespace separate from FILEHANDLEs.

readdir(DIRHANDLE)
readdir DIRHANDLE
Returns the next directory entry for a directory opened by opendir(). If used in an array context, returns all the rest of the entries in the directory. If there are no more entries, returns an undefined value in a scalar context or a null list in an array context.

rewinddir(DIRHANDLE)
rewinddir DIRHANDLE
Sets the current position to the beginning of the directory for the readdir() routine on DIRHANDLE.

seekdir(DIRHANDLE,POS)
Sets the current position for the readdir() routine on DIRHANDLE. POS must be a value returned by telldir(). Has the same caveats about possible directory compaction as the corresponding system library routine.

telldir(DIRHANDLE)
telldir DIRHANDLE
Returns the current position of the readdir() routines on DIRHANDLE. Value may be given to seekdir() to access a particular location in a directory. Has the same caveats about possible directory compaction as the corresponding system library routine.