RosettaCodeData/Task/File-input-output/Standard-ML/file-input-output.ml

11 lines
270 B
Standard ML

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;