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

12 lines
297 B
Standard ML

(* string -> string -> bool *)
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