Data update
This commit is contained in:
parent
0df55f9f24
commit
aec8ed51b6
1045 changed files with 18889 additions and 2777 deletions
|
|
@ -1,4 +1,5 @@
|
|||
fun copyFile (from, to) =
|
||||
(* string -> string -> bool *)
|
||||
fun copyFile from to =
|
||||
let
|
||||
val instream = TextIO.openIn from
|
||||
val outstream = TextIO.openOut to
|
||||
|
|
@ -7,4 +8,4 @@ let
|
|||
val () = TextIO.closeOut outstream
|
||||
in
|
||||
true
|
||||
end handle _ => false;
|
||||
end handle _ => false
|
||||
15
Task/File-input-output/Standard-ML/file-input-output-2.ml
Normal file
15
Task/File-input-output/Standard-ML/file-input-output-2.ml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
fun copyFile from to =
|
||||
let
|
||||
val instream = BinIO.openIn from
|
||||
val outstream = BinIO.openOut to
|
||||
fun aux () =
|
||||
let
|
||||
val buf = BinIO.inputN(instream, 1024)
|
||||
in
|
||||
if Word8Vector.length buf = 0
|
||||
then ()
|
||||
else (BinIO.output (outstream, buf); aux ())
|
||||
end
|
||||
in
|
||||
(aux (); BinIO.closeIn instream; BinIO.closeOut outstream)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue