z/OS Using REXX and z/OS UNIX System Services
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


rewinddir

z/OS Using REXX and z/OS UNIX System Services
SA23-2283-00

Read syntax diagramSkip visual syntax diagram
>>-rewinddir--fd-----------------------------------------------><

Function

rewinddir invokes the rewinddir callable service to rewind, or reset, to the beginning of an open directory. The next call to rddir reads the first entry in the directory.

Parameters

fd
The file descriptor (a number) returned from an opendir syscall command. This is the file descriptor for the directory to be reset.

Usage notes

You can use this command only with file descriptors opened using the opendir syscall command. The rddir syscall command reads a directory in the readdir callable service format. You can use opendir, rewinddir, and closedir together with the rddir syscall command, but not with the readdir syscall command. Alternatively, you can use readdir syscall command to read an entire directory and format it in a stem.

If the contents of the directory you specify have changed since the directory was opened, a call to the rewinddir service will reset the pointer into the directory to the beginning so that a subsequent call to the readdir service will read the new contents.

Example

To rewind the directory associated with file descriptor 4:
"rewinddir 4"

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014