INPUT FROM OS-DIR
- Last Updated: March 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
INPUT FROM OS-DIR
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.
See ABL Reference for more information on the
INPUT FROM statement.