curl_fetch_disk关闭,没有错误消息

时间:2018-11-19 14:39:42

标签: r curl fetch disk

下面的代码在一分钟后一直关闭,没有错误消息。有人知道为什么吗?我认为这与功能curl_fetch_disk ...

有关
library(dplyr)
library(curl)

main.dir <- "C:/Users/blue/Desktop/Arc"

liste.urls <- read.csv('C:/Users/blue/Desktop/Arc/test2.csv', header = FALSE)

subsub.dir <- 'hydro_l'

liste.urls$hydro_l <- paste0(liste.urls$V1, "/hydro_l/")

liste.urls$rep <- sapply(liste.urls, substring, 94, 100)

for (i in 1:length(liste.urls)) {
     url.download <- as.character(liste.urls$hydro_l[i+6])
     handle = new_handle(dirlistonly = TRUE)
     con = curl(url.download, "r", handle)
     tbl = read.table(con, stringsAsFactors = TRUE, fill = TRUE)
     close(con)
     head(tbl)

     liste.fichiers.urls <- paste0(url.download, tbl[, 1])

     fichiers = basename(liste.fichiers.urls)

     sub.dir <- liste.urls$rep[i+6]
     dir.create(file.path(main.dir, sub.dir))
     dir.create(file.path(main.dir, sub.dir, subsub.dir))
     setwd(file.path(main.dir, sub.dir, subsub.dir))

            for (j in 1:length(liste.fichiers.urls)) {
            curl_fetch_disk(liste.fichiers.urls[j], fichiers[j])

        }
   }

0 个答案:

没有答案