Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add overwrite arg to downloadModule & downloadData #7

Closed
eliotmcintire opened this issue Nov 10, 2017 · 8 comments
Closed

Add overwrite arg to downloadModule & downloadData #7

eliotmcintire opened this issue Nov 10, 2017 · 8 comments

Comments

@eliotmcintire
Copy link
Contributor

eliotmcintire commented Nov 10, 2017

@CeresBarros suggested an overwrite argument. It would have to be passed through to GET to httr::write_disk which actually does the writing to disk.

Perhaps like this:
(https://yokekeong.com/download-files-over-https-in-r-with-httr/)

e.g.,

    library(httr)
    url <- "https://rawgit.com/yoke2/dsxref/master/iris.xlsx"
    GET(url, write_disk("iris.xlsx", overwrite=TRUE))
@achubaty
Copy link
Contributor

NOTE: download.file already overwrites by default

@eliotmcintire
Copy link
Contributor Author

presumably a FALSE is also relevant, thus the need for argument

@achubaty
Copy link
Contributor

achubaty commented Dec 16, 2017 via email

@CeresBarros
Copy link
Member

CeresBarros commented Dec 19, 2017

I've added an overwrite option to downloadModule and opened a PR. There seem to be two minor conflicts (which I think I solved?) on the .R and .Rd files for downloadModules.
I've also tried to clarify the documentation of getModuleVersion, as I felt it wasn't clear where the version was being extracted from.

@CeresBarros
Copy link
Member

Also, in response to Alex's last comment: are you sure the overwrite option can be passed to GET? I've passed if to write_disk in downloadModule, because I couldn't find an overwrite option in GET.

@achubaty
Copy link
Contributor

Thanks @CeresBarros! The overwrite arg is passed to write_disk inside the GET call; see the example Eliot used in the first message in this thread. It sounds like you used it correctly. I'll review the PR later tonight.

@achubaty
Copy link
Contributor

@CeresBarros did you also add it to downoladData?

@CeresBarros
Copy link
Member

CeresBarros commented Dec 19, 2017

Nop, but if overwrite passes from GET to write_disk I'll do it :)

@achubaty achubaty closed this as completed Jan 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants