iiasa / rN2000

R package to access and process Natura 2000 data
Creative Commons Attribution 4.0 International
3 stars 0 forks source link

Bug in unzip on Windows #6

Open matthewlewis896 opened 3 years ago

matthewlewis896 commented 3 years ago

unzip gives a warning and fails to unzip correctly on Windows.

Having done some digging I believe this relates to download.file() and this post: https://stackoverflow.com/questions/12467001/download-file-fails-when-appending-a-random-suffix-to-the-filename

Changing the mode argument in download.file() to 'wb' fixes this behaviour. This has been implemented in matt branch.

Need to check whether this affects ability of other OS to download or unzip files. @Martin-Jung

Martin-Jung commented 3 years ago

Thanks. Fine with me if this fixes things. I haven't tested the download script as I already saved the database separately. In principle it should be possible to do a simple .Platform$OS.type check on the OS and then implement specific behaviours. In terms of priorities I judge this rather low though. Would work with an already downloaded version for now since the N2000 database doesn't change that often (once every a year at most).