RosettaCodeData/Task/File-input-output/Oz/file-input-output.oz

18 lines
381 B
Text
Raw Permalink Normal View History

2013-04-10 22:43:41 -07:00
declare
class TextFile from Open.file Open.text end
In = {New TextFile init(name:"input.txt")}
Out = {New TextFile init(name:"output.txt" flags:[write text create truncate])}
proc {CopyAll In Out}
case {In getS($)} of false then skip
[] Line then
{Out putS(Line)}
{CopyAll In Out}
end
end
in
{CopyAll In Out}
{Out close}
{In close}