Closed dankelley closed 2 months ago
My first trial didn't work. Trial 2 pushed to GH, to start the R-CMD-check process.
With trial 2, using
urlNC <- paste0(
"https://cproof.uvic.ca/gliderdata/deployments/",
"dfo-eva035/dfo-eva035-20190718/",
"/L0-timeseries/dfo-eva035-20190718_delayed.nc"
)
fileNC <- file.path(tmpdir, sub(".*/", "", urlNC))
download.file(urlNC, fileNC)
G <- read.glider.netcdf(fileNC)
I get as follows.
Error in nc_open trying to open file C:\Users\RUNNER~1\AppData\Local\Temp\RtmpoH8aSJ/dfo-eva035-20190718_delayed.nc (return_on_error= FALSE )
I'm not sure what else to try. Should I try (how?) to detect that it's a windows machine, and just construct the path myself? Or maybe it never downloaded the file.
I note that the docs for file.path()
say that it uses /
instead of \
on windows. I was under the impression that this would be okay -- that the default would only be /
if it would work.
The fact that this all works on mac and linux suggests that it's not some other blunder, apart from the /
versus \
.
I may fiddle some more, but I think I'm at an impasse.
This is not super-high priority, because I've done all the other cleanup I wanted to do, and got everything into a shape that could go to CRAN if the group decides on that.
I'm going to post a question on an R developers mailing list.
Maybe sometime when @richardsc is at Dal and has a windows machine, we could try a realtime test, to see if the file downloads, whether it's present, etc.
Fixed, with near-instant help from @clayton33 :-)
A snippet is below. I thought windows accepted
/
in filenames but maybe I need to use https://rdrr.io/r/base/file.path.html ... although the docs for that say that it will use/
by default. I dunno -- worth a try.