INPUT FROM OS-DIR
- Last Updated: February 9, 2026
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
You generally use the INPUT FROM
statement to read the contents of an operating system file; however, you
can also read a list of the files in a directory using the OS-DIR option of the INPUT FROM
statement. The INPUT FROM statement specifies a new
input source. Using INPUT FROM OS-DIR indicates
that you want your input to be the filenames found in the directory you specify. If
that directory is not a valid directory or you do not have permission to read it, an
error condition occurs. Otherwise, OpenEdge generates the directory list and sends
it to the calling program through the INPUT stream.
An INPUT CLOSE statement discards any unread
filenames from the list.
The following example uses the
OS-GETENV function to find the path of the DLC directory, then uses the OS-DIR
option of INPUT FROM to read the contents of the
directory:
|
When you use the OS-DIR option, the
UNBUFFERED option is ignored. OS-DIR always buffers exactly one filename at a time.
When you try to read beyond the last filename in the list, OpenEdge generates the
ENDKEY condition.For more information, see INPUT-FROM statement.