You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Firstly, thanks for this package it is hugely appreciated!
I recently noticed that when using curl::multi_download the destfile column of the returned data.frame object differs depending on whether the file is resumed on completed on first go. When a file is resumed, the destfile is absoloute but when it completes in one it is relative. See here for a reprex:
suppressPackageStartupMessages({
library(curl)
library(R.utils)
})
# Example: some large filesurls1<- sprintf(
"https://d37ci6vzurychx.cloudfront.net/trip-data/yellow_tripdata_2021-%02d.parquet", 1:2
)
# cancel download after 5 secondsres1<- try(withTimeout(multi_download(urls1, resume=TRUE), timeout=5)) # You can interrupt (ESC) and resume# now escape the download and resumeres1<- multi_download(urls1, resume=TRUE)
urls2<- sprintf(
"https://d37ci6vzurychx.cloudfront.net/trip-data/yellow_tripdata_2021-%02d.parquet", 3:4
)
# Do not escape this.res2<- multi_download(urls2, resume=FALSE) # You can interrupt (ESC) and resume# full filepaths returned when resumed
print(res1$destfile)
#> [1] "/tmp/RtmpbPZ3Zs/reprex-146af8714e091d-awake-topi/yellow_tripdata_2021-01.parquet"#> [2] "/tmp/RtmpbPZ3Zs/reprex-146af8714e091d-awake-topi/yellow_tripdata_2021-02.parquet"# relative filepaths returned when completed in one go.
print(res2$destfile)
#> [1] "yellow_tripdata_2021-03.parquet" "yellow_tripdata_2021-04.parquet"
The text was updated successfully, but these errors were encountered:
h-a-graham
changed the title
Inconsistent filepaths returned from multi_download when resumed.
Inconsistent file paths returned from multi_download when resumed.
Sep 12, 2024
Hello,
Firstly, thanks for this package it is hugely appreciated!
I recently noticed that when using
curl::multi_download
the destfile column of the returned data.frame object differs depending on whether the file is resumed on completed on first go. When a file is resumed, the destfile is absoloute but when it completes in one it is relative. See here for a reprex:Created on 2024-09-12 with reprex v2.1.1
Is the solution perhaps as simple as setting destfiles to
normalizePath(destfiles, mustWork = FALSE )
in:https://github.com/jeroen/curl/blob/master/R/multi_download.R#L186
Cheers,
Hugh
The text was updated successfully, but these errors were encountered: