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

12 lines
297 B
OCaml
Raw Permalink Normal View History

2024-04-19 16:56:29 -07:00
(* string -> string -> bool *)
fun copyFile from to =
2023-07-01 11:58:00 -04:00
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
2024-04-19 16:56:29 -07:00
end handle _ => false