RosettaCodeData/Task/File-input-output/GAP/file-input-output.gap
2015-02-20 09:02:09 -05:00

15 lines
287 B
Text

CopyFile := function(src, dst)
local f, g, line;
f := InputTextFile(src);
g := OutputTextFile(dst, false);
while true do
line := ReadLine(f);
if line = fail then
break
else
WriteLine(g, Chomp(line));
fi;
od;
CloseStream(f);
CloseStream(g);
end;