Data update
This commit is contained in:
parent
0df55f9f24
commit
aec8ed51b6
1045 changed files with 18889 additions and 2777 deletions
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