On 2020-10-20, at 10:38:12, Dave Jones wrote: > > Just a quick note to let the pipers on the list know that the popen > co-pipes interface, documented here: > http://vm.marist.edu/~pipeline/popen.pdf, also works with the newer IBM > z/VM C/C++ V 1.3 compiler, too. > Where I read: Using the subroutines in FPLPOP you can create a pipeline to process output data from your program or you can create a pipeline that will supply data to your program, just like with the UNIX popen() function, which is mimicked by the four entry points provided in FPLPOP.
"just like" is an exaggeration. The UNIX popen() function returns a FILE* pointer which can be used as an argument to the UNIX functions such as fread(), fwrite(), fscanf(), fprintf(), etc. No need to do FPLREAD(); scanf; or snprintf(); FPLWRITE(). That makes adapting existing C programs to use pipes simple: only the calls to fopen() and fclose need to be changed to popen() and pclose() respectively. Even more for supporting both forms: only those two calls need to be dual-path; all other I/O functions remain unchanged. Long ago, circa MVS/370, I was maintaining the runtime library for a FOSS Pascal system. I added pipe support by modifying the DCB pointer DCBEOBRA or DCBEOBW to my code. All other Pascal I/O functions remained unchanged. The facility did not gain wide acceptance. The author remained the only user. -- gil
