Re: [Rd] Suggestion: Change default to download.file(..., mode="wb") ...instead of mode="w" with some bells and whistles

From: steven mosher <>
Date: Wed, 05 Sep 2012 09:39:48 -0700

 I would second this suggestion.

On Wed, Aug 29, 2012 at 12:27 PM, Henrik Bengtsson <>wrote:

> Hi,
> I keep seeing the problem where people are download binary files as
> text (mode="w") when using R's download.file() for FTP/HTTP downloads.
> It often results in unnecessary troubleshooting until one concludes
> that the downloaded file has been corrupted due to (what I think is)
> translated newlines. Search the r-help mailing list and you'll find
> other examples of this. This may or may not only be a problem for
> Windows users.
> I'd like to suggest to change the default of argument 'mode' of
> download.file() to be mode="wb". The "default" is current mode="w"
> except when argument 'mode' is missing (not explicitly given),
> download.file() tries to be helpful by forcing 'mode' to be "wb" for
> certain filename extensions. NB: help("download.file",
> package="utils") has a paragraph on all this. BTW, the latter seems
> to be done in a case-sensitive way, such that *.zip and *.ZIP will
> have different behaviors.
> Wouldn't it just be safer to change the default to mode="wb"? ...or
> are there use cases that I'm overseeing - is anyone out there
> intentionally using the "text" transfer mode?
> /Henrik
> ______________________________________________
> mailing list

        [[alternative HTML version deleted]] mailing list Received on Wed 05 Sep 2012 - 16:42:14 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 06 Sep 2012 - 01:30:44 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive