Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/pkg/io/example/   (Algebra von RWTH Aachen Version 4.15.1©)  Datei vom 21.5.2025 mit Größe 487 B image not shown  

Quelle  popen2.g   Sprache: unbekannt

 
# Pipes some megabytes through /bin/cat:
LoadPackage("io");
s := "Max";
for i in [1..25] do Append(s,s); od;
Print("Have string of length ",Length(s),".\n");
p := IO_Popen2("/bin/cat",[]);
IO_SendStringBackground(p.stdin,s);
# We want that /bin/cat terminates after the child has sent everything:
IO_Close(p.stdin);
t := IO_ReadUntilEOF(p.stdout);
IO_Close(p.stdout);
Print("Have read string!\n");
if s <> t then
    Print("Alert: Received string not identical to original one!\n");
fi;

[ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet)  ]