| Special File Handling |
|
| This
functionality is a +PxPlus
Exclusive |
||||||||||||||||
| Format | OPEN
(chan[,option])"*STDIO*" -or- SELECT ... FROM "*STDIO*"
|
|||||||||||||||
| Description | The *STDIO*
logical file can be used in the WIndows environment to
gain access to the logical 'stdin' and 'stdout'
files. Normally when running on windows there is no stdin or stdout attached to the ProvideX process, however when launched from command line with piped input or output the process will have a stdin or standard output file assigned by the operating system. As all IO to channel zero is effectively routed to the windows screen, the application will need to specifically open *STDIO* in order to access these standard IO assignments. When reading from stdin the input is considered a system device thus you should issue a READ to accept individual lines or READ RECORD to read a specific length of data. |
|||||||||||||||
| Examples | Reading
Standard Input (stdin):
In the program prog01 you could then read the output of the DIR command:
Writing to Standard Output (stdout): The following will output a sorted directory listing piping through the Windows sort command:
Where the program prog02 contains:
|
|||||||||||||||
| *Note* | If neither stdin or stdout are allocated to the process, the OPEN will fail with file not found (Error 12) | |||||||||||||||