Problem about using functions in RCurl to download a zipped file
0
0
Entering edit mode
li lilingdu ▴ 450
@li-lilingdu-1884
Last seen 5.9 years ago
Sean Davis <sdavis2 at="" ...=""> writes: > > On Wed, Nov 12, 2008 at 12:28 AM, LiGang <luzifer.li at="" ...=""> wrote: > > > Dear list, > > > > How to use functions in RCurl to download a zipped file such as the one > > listed in the following URL: > > > > > > http://bioconductor.org/packages/2.3/bioc/bin/windows/contrib/2.8/ABar ray_1.10. 0.zip > > > > Following code does not work: > > > > getURL(" > > > > http://bioconductor.org/packages/2.3/bioc/bin/windows/contrib/2.8/ABar ray_1.10. 0.zip > > ") > > > > > > nor : > > > > getURL(" > > > > http://bioconductor.org/packages/2.3/bioc/bin/windows/contrib/2.8/ABar ray_1.10. 0.zip > > ",file="target.zip") > > > > > > P.S. > > > > How should the 'file' option in getURL function be specified? > > > > You'll probably want to read the help for getURL. It does not have a "file" > argument. It is for reading URLs directly. In this case (judging from what > you want to do), I would suggest using download.file() instead. > > If you really need to use RCurl, then you might need to look at the "write" > argument, which would probably allow you to write things to disk as they > come in. But, you will need to write the handler to have it do > this--specifying a file name will not work, if that isn't obvious from the > help. You would have to be careful with this, though, as .zip files are > binary. > > Sean > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at ... > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor > > Dear Sean, Thanks for your suggestions. "file" is one of 113 CURLOptions ============== library(RCurl) "file" %in% listCurlOptions() ============== The following system command does work. curl http://bioconductor.org/packages/2.3/bioc/bin/windows/contrib/2.8/ABar ray_1.10. 0.zip -O I wonder how CurlOptions such as "file" or/and "write" could be set in RCurl package to fulfill the above curl functionality. Any suggestions? --- LiGang
• 718 views
ADD COMMENT

Login before adding your answer.

Traffic: 955 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6