The Channel class / Examples |
This program executes the ls command and displays the filenames and extensions separately.
MAIN DEFINE fn CHAR(40) DEFINE ex CHAR(10) DEFINE ch base.Channel LET ch = base.Channel.create() CALL ch.setDelimiter(".") CALL ch.openPipe("ls -l","r") WHILE ch.read([fn,ex]) DISPLAY fn, " ", ex END WHILE CALL ch.close() END MAIN