Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
6
Task/File-input-output/R/file-input-output-1.r
Normal file
6
Task/File-input-output/R/file-input-output-1.r
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
src <- file("input.txt", "r")
|
||||
dest <- file("output.txt", "w")
|
||||
|
||||
fc <- readLines(src, -1)
|
||||
writeLines(fc, dest)
|
||||
close(src); close(dest)
|
||||
7
Task/File-input-output/R/file-input-output-2.r
Normal file
7
Task/File-input-output/R/file-input-output-2.r
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
src <- file("input.txt", "rb")
|
||||
dest <- file("output.txt", "wb")
|
||||
|
||||
while( length(v <- readBin(src, "raw")) > 0 ) {
|
||||
writeBin(v, dest)
|
||||
}
|
||||
close(src); close(dest)
|
||||
1
Task/File-input-output/R/file-input-output-3.r
Normal file
1
Task/File-input-output/R/file-input-output-3.r
Normal file
|
|
@ -0,0 +1 @@
|
|||
file.copy("input.txt", "output.txt", overwrite = FALSE)
|
||||
Loading…
Add table
Add a link
Reference in a new issue