RosettaCodeData/Task/File-input-output/Oforth/file-input-output-1.fth
2023-07-01 13:44:08 -04:00

7 lines
210 B
Forth

: fcopy(in, out)
| f g |
File newMode(in, File.BINARY) dup open(File.READ) ->f
File newMode(out, File.BINARY) dup open(File.WRITE) ->g
while(f >> dup notNull) [ g addChar ] drop
f close g close ;