File input/output: Difference between revisions
m
→{{header|Julia}}
No edit summary |
|||
Line 1,802:
=={{header|Julia}}==
Here we read the content of file1 into the variable
<lang Julia>
open(io->write(io,
Note however that Julia has a `cp` function to copy the content of a file to another file.
<lang julia>cp("file1","file2")</lang>
Line 1,810:
<lang Julia>infile = open("file1", "r")
outfile = open("file2", "w")
write(outfile,
close(outfile)
close(infile)</lang>
Here is a one-liner that guarantee that the file handle is closed
even if something goes wrong during the read/write phase.
<lang Julia>open(IO ->write(IO,
=={{header|K}}==
|