Update all new Tasks
This commit is contained in:
parent
00a190b0a6
commit
91df62d461
5697 changed files with 93386 additions and 804 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