Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/tst/testinstall/testunix/   (Algebra von RWTH Aachen Version 4.15.1©)  Datei vom 18.9.2025 mit Größe 587 B image not shown  

Quelle  streams.tst   Sprache: unbekannt

 
gap> START_TEST("streams.tst");

#
# input/output streams
#
gap> d := DirectoryCurrent();;
#@if ARCH_IS_UNIX()
gap> f := PathSystemProgram("cat");;
gap> s := InputOutputLocalProcess(d,f,[]);
< input/output stream to cat >
gap> WriteLine(s,"The cat sat on the mat");
true
gap> repeat str := ReadLine(s); until str <> fail; str;
"The cat sat on the mat\n"
gap> WriteLine(s,"abc");
true
gap> WriteLine(s,"xyz");
true
gap> repeat str := ReadAllLine(s); until str <> fail; str;
"abc\n"
gap> CloseStream(s);
gap> s;
< closed input/output stream to cat >
#@fi

#
gap> STOP_TEST("streams.tst");

[ Dauer der Verarbeitung: 0.19 Sekunden  (vorverarbeitet)  ]