Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Reading files from the web #13

Closed
gustavobio opened this issue Jun 21, 2016 · 2 comments
Closed

Reading files from the web #13

gustavobio opened this issue Jun 21, 2016 · 2 comments
Milestone

Comments

@gustavobio
Copy link
Contributor

Hi,

Links to DWC-A files shared with the integrated publishing toolkit usually look like this:

http://ipt.jbrj.gov.br/jbrj/archive.do?r=redlist_2013_taxons&v=3.12

However, dwca_read() uses the provided url to get the name of the file where the data will be stored:

basename("http://ipt.jbrj.gov.br/jbrj/archive.do?r=redlist_2013_taxons&v=3.12")

basename("http://ipt.jbrj.gov.br/jbrj/archive.do?r=redlist_2013_taxons&v=3.12")
[1] "archive.do?r=redlist_2013_taxons&v=3.12"

This doesn't work well as R can't find the path to the zip file later on:

Error in unzip(writepath, exdir = dirpath) :
cannot open file '/Users/gustavo/archive.do?r=lista_especies_flora_brasil&v=393.71/resourcerelationship.txt': Not a directory

I guess this could be solved by changing the basename to something else when the url isn't a direct link to a zip file.

Thanks!

@sckott
Copy link
Contributor

sckott commented Jun 21, 2016

thanks @gustavobio !

Right, we should go with something more robust. Perhaps even just use tempfile()

@sckott sckott added this to the v0.1 milestone Aug 17, 2016
@sckott sckott closed this as completed in 9da6116 Aug 17, 2016
@sckott
Copy link
Contributor

sckott commented Aug 17, 2016

@gustavobio reinstall, should work now

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants