Skip to content
Prev 55189 / 63424 Next

download.file does not process gz files correctly (truncates them?)

Martin, also from me a heartfelt thank you for taking care of this. Some
thoughts on Henrik's response:

On Mon, May 7, 2018 at 2:28 AM, Henrik Bengtsson <henrik.bengtsson at gmail.com
I agree with your analysis of the problems this legacy behaviour causes.

Deprecating the default mode="w" on Windows can be done in steps, e.g.
That sounds like a reasonable way to move away from this discrepancy
between OS.
Totally agree, and easily solved by eg adding ignore.case = TRUE to the
grep() call.
If the default isn't changed, doesn't it make more sense to actually turn
the logic around? Text files that are downloaded over the internet are
almost always .txt, .csv, or a few other extensions used for text data .
Those are actually the only files where some people with very old Windows
programs for text processing can get into trouble. So instead of adding
every possible binary extension, one can put "wb" as default and change to
"w" if it is a text file instead of the other way around. That would not
change the concept of the behaviour, but ensures that the function doesn't
fail to detect a binary file. Not detecting a text file is far less of a
problem, as not converting the line endings doesn't destruct the file.

Cheers
Joris

Thread (25 messages)

Joris Meys download.file does not process gz files correctly (truncates them?) May 2 Joris Meys download.file does not process gz files correctly (truncates them?) May 3 Martin Morgan download.file does not process gz files correctly (truncates them?) May 3 Joris Meys download.file does not process gz files correctly (truncates them?) May 3 Henrik Bengtsson download.file does not process gz files correctly (truncates them?) May 3 Duncan Murdoch download.file does not process gz files correctly (truncates them?) May 3 Martin Morgan download.file does not process gz files correctly (truncates them?) May 3 Jeroen Ooms download.file does not process gz files correctly (truncates them?) May 3 Joris Meys download.file does not process gz files correctly (truncates them?) May 3 Henrik Bengtsson download.file does not process gz files correctly (truncates them?) May 3 Tomas Kalibera download.file does not process gz files correctly (truncates them?) May 3 Martin Maechler download.file does not process gz files correctly (truncates them?) May 4 Joris Meys download.file does not process gz files correctly (truncates them?) May 4 Martin Maechler download.file does not process gz files correctly (truncates them?) May 4 Henrik Bengtsson download.file does not process gz files correctly (truncates them?) May 6 Joris Meys download.file does not process gz files correctly (truncates them?) May 7 Hugh Parsonage download.file does not process gz files correctly (truncates them?) May 7 Gabriel Becker download.file does not process gz files correctly (truncates them?) May 7 Hadley Wickham download.file does not process gz files correctly (truncates them?) May 8 Hadley Wickham download.file does not process gz files correctly (truncates them?) May 8 Tomas Kalibera download.file does not process gz files correctly (truncates them?) May 9 Duncan Murdoch download.file does not process gz files correctly (truncates them?) May 9 Peter Dalgaard download.file does not process gz files correctly (truncates them?) May 9 Dirk Eddelbuettel download.file does not process gz files correctly (truncates them?) May 9 Joris Meys download.file does not process gz files correctly (truncates them?) May 12