[R] download truncating large files

jim holtman jholtman at gmail.com
Mon Sep 17 14:36:06 CEST 2012


Try downloading the zip file using the browser interface to see if it
might be something with your proxy.  Do this outside of R to see if
you have the same problem.  After that, you can just install from a
local zip file.

On Mon, Sep 17, 2012 at 5:21 AM, Ian Shannon
<Ian.Shannon at environment.nsw.gov.au> wrote:
> Hi there,
>
> I have had a problem with loading the package XLConnectJars_0.2-0.zip from the CRAN mirrors. The problem occurs when executing
> utils:::menuInstallPkgs()
> I have traced the problem down to the "download" internal command.  It appears that files over approx 15 MB are being truncated.  The exact point of truncation varies slightly but the truncation is on a 4096-byte boundary.
>
> I am running =>
>
>
> R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows"
> Copyright (C) 2012 The R Foundation for Statistical Computing
> ISBN 3-900051-07-0
> Platform: i386-pc-mingw32/i386 (32-bit)
>
> I have also run the code using the -- vanilla  start-up parameter with no change in outcome.
>
> I am using  "internet2"  to get past our proxy server.  I have isolated the problem using the following script
> derived from a code fragment called by the menuInstallPkgs() function.
>
> options(timeout = 120)   makes no difference because the failure occurs before the timeout of 60 (or 120) seconds elapses.
>
>
> ## sample R code sequence to reproduce error
> setInternet2(TRUE);
> url <- "http://cran.csiro.au/bin/windows/contrib/2.15/";
> dir <- "U:\\";
>
> ## This download being reasonable small works OK
> file <- "XLConnect_0.2-1.zip";
> status <- .Internal(download(paste0(url, file), paste0(dir, file), quiet=FALSE, mode="wb", cacheOK=FALSE));
> cat(paste("the value of status for",  file, "is", status, "\n\n"));
>
>
> ## This big download fails - a progress indicator quickly progresses to 99% and stops
> file <- "XLConnectJars_0.2-0.zip";
> status <- .Internal(download(paste0(url, file), paste0(dir, file), quiet=FALSE, mode="wb", cacheOK=FALSE));
> cat(paste("the value of status for",  file, "is", status, "\n\n"));
>
>
>
> This produces the following output -
>
>
> trying URL 'http://cran.csiro.au/bin/windows/contrib/2.15/XLConnect_0.2-1.zip'
> Content type 'application/zip' length 1358587 bytes (1.3 Mb)
> opened URL
> downloaded 1.3 Mb
>
> the value of status for XLConnect_0.2-1.zip is 0
>
> trying URL 'http://cran.csiro.au/bin/windows/contrib/2.15/XLConnectJars_0.2-0.zip'
> Content type 'application/zip' length 16486857 bytes (15.7 Mb)
> opened URL
> downloaded 15.6 Mb
>
> the value of status for XLConnectJars_0.2-0.zip is 0
>
> Warning message:
> In eval(expr, envir, enclos) :
>   downloaded length 16355328 != reported length 16486857
>>
>
>
>
> Any suggestions on what is needed to get this going?
>
> Thanks,
>
>
> Ian
> Ian Shannon
> Landscape Modelling & Decision Support
> Scientific Services
> Office of Environment and Heritage
> Department of Premier and Cabinet
> PO Box A290
> Sydney South
> NSW      1232
> +61 2 99 955 490
> Ian dot Shannon at Environment dot nsw dot gov dot au
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
> This email is intended for the addressee(s) named and may contain confidential and/or privileged information.
> If you are not the intended recipient, please notify the sender and then delete it immediately.
> Any views expressed in this email are those of the individual sender except where the sender expressly and with authority states them to be the views of the Office of Environment and Heritage, NSW Department of Premier and Cabinet.
>
> PLEASE CONSIDER THE ENVIRONMENT BEFORE PRINTING THIS EMAIL
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



-- 
Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.




More information about the R-help mailing list