File input/output: Difference between revisions

Content added Content deleted
No edit summary
No edit summary
Line 3,651: Line 3,651:
while output = input :s(while)
while output = input :s(while)
end</syntaxhighlight>
end</syntaxhighlight>

=={{header|Standard ML}}==
{{works with|SML/NJ|110.59}}
<syntaxhighlight lang="sml">fun copyFile (from, to) =
let
val instream = TextIO.openIn from
val outstream = TextIO.openOut to
val () = TextIO.output (outstream, TextIO.inputAll instream)
val () = TextIO.closeIn instream
val () = TextIO.closeOut outstream
in
true
end handle _ => false;</syntaxhighlight>


=={{header|SparForte}}==
=={{header|SparForte}}==
Line 3,708: Line 3,695:


end filecopy;</syntaxhighlight>
end filecopy;</syntaxhighlight>

=={{header|Standard ML}}==
{{works with|SML/NJ|110.59}}
<syntaxhighlight lang="sml">fun copyFile (from, to) =
let
val instream = TextIO.openIn from
val outstream = TextIO.openOut to
val () = TextIO.output (outstream, TextIO.inputAll instream)
val () = TextIO.closeIn instream
val () = TextIO.closeOut outstream
in
true
end handle _ => false;</syntaxhighlight>


=={{header|Stata}}==
=={{header|Stata}}==