RInside Version 0.2.16
unix2dos.r
Go to the documentation of this file.
1 
2 ## simple 0d 0a -> 0a converter to suppress a warning on Windows
3 
4 filename <- commandArgs(trailingOnly=TRUE)[1]
5 if (!file.exists(filename)) q()
6 
7 con <- file(filename, "rb")
8 bin <- readBin(con, raw(), 100000)
9 bin <- bin[ which(bin != "0d") ]
10 close(con)
11 
12 Sys.sleep(1)
13 
14 con <- file(filename, "wb")
15 writeBin(bin, con)
16 close(con)
17