diff --git a/R/delete_mirror.R b/R/delete_mirror.R index db711ad..e3af94b 100644 --- a/R/delete_mirror.R +++ b/R/delete_mirror.R @@ -8,8 +8,10 @@ #' #' @examplesIf curl::has_internet() & RCurl::url.exists("https://zenodo.org/records/10959197", timeout.ms = 5000) #' # https://zenodo.org/records/10959197 -#' zen_file(10959197, "iris.rds") +#' file_path <- zen_file(10959197, "iris.rds") +#' print(file_path) #' delete_mirror(10959197) +#' file.exists(file_path) #' #' @export delete_mirror <- function(deposit_id){ @@ -30,8 +32,10 @@ delete_mirror <- function(deposit_id){ #' #' @examplesIf curl::has_internet() & RCurl::url.exists("https://zenodo.org/records/10959197", timeout.ms = 5000) #' # https://zenodo.org/records/10959197 -#' zen_file(10959197, "iris.rds") -#' delete_all_mirrors() +#' file_path <- zen_file(10959197, "iris.rds") +#' print(file_path) +#' delete_all_mirrors(10959197) +#' file.exists(file_path) #' #' @export delete_all_mirrors <- function(){ diff --git a/R/download_deposit.R b/R/download_deposit.R index 3ee6766..20cff27 100644 --- a/R/download_deposit.R +++ b/R/download_deposit.R @@ -11,6 +11,8 @@ #' res <- list_deposit(deposit_id = 10959197) #' temp_dir <- tempdir() #' download_deposit(list_deposit = res, dest = temp_dir, quiet = FALSE) +#' file.exists(file.path(temp_dir, "iris.rds")) +#' file.exists(file.path(temp_dir, "mtcars.rds")) #' #' @export download_deposit <- function(list_deposit, file_name = NULL, dest, quiet = FALSE){ diff --git a/R/mirror_deposit.R b/R/mirror_deposit.R index b0a47f4..b22ddce 100644 --- a/R/mirror_deposit.R +++ b/R/mirror_deposit.R @@ -12,6 +12,8 @@ #' @examplesIf curl::has_internet() & RCurl::url.exists("https://zenodo.org/records/10959197", timeout.ms = 5000) #' # https://zenodo.org/records/10959197 #' mirror_deposit(deposit_id = 10959197) +#' file.exists(file.path(temp_dir, "iris.rds")) +#' file.exists(file.path(temp_dir, "mtcars.rds")) #' #' @export #' diff --git a/R/zen_file.R b/R/zen_file.R index e67d12e..13b393b 100644 --- a/R/zen_file.R +++ b/R/zen_file.R @@ -12,6 +12,7 @@ #' @examplesIf curl::has_internet() & RCurl::url.exists("https://zenodo.org/records/10959197", timeout.ms = 5000) #' # https://zenodo.org/records/10959197 #' zen_file(10959197, "iris.rds") +#' file.exists(file.path(temp_dir, "iris.rds")) #' #' @export zen_file <- function(deposit_id, file_name, clear_cache = FALSE, quiet = FALSE){ diff --git a/man/delete_all_mirrors.Rd b/man/delete_all_mirrors.Rd index a5aa6e8..a839c95 100644 --- a/man/delete_all_mirrors.Rd +++ b/man/delete_all_mirrors.Rd @@ -15,7 +15,9 @@ This will delete all deposit mirrors stored locally. \examples{ \dontshow{if (curl::has_internet() & RCurl::url.exists("https://zenodo.org/records/10959197", timeout.ms = 5000)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # https://zenodo.org/records/10959197 -zen_file(10959197, "iris.rds") -delete_all_mirrors() +file_path <- zen_file(10959197, "iris.rds") +print(file_path) +delete_all_mirrors(10959197) +file.exists(file_path) \dontshow{\}) # examplesIf} } diff --git a/man/delete_mirror.Rd b/man/delete_mirror.Rd index 5cb1d8b..caffad1 100644 --- a/man/delete_mirror.Rd +++ b/man/delete_mirror.Rd @@ -18,7 +18,9 @@ This function will delete all mirrored files stored locally. \examples{ \dontshow{if (curl::has_internet() & RCurl::url.exists("https://zenodo.org/records/10959197", timeout.ms = 5000)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # https://zenodo.org/records/10959197 -zen_file(10959197, "iris.rds") +file_path <- zen_file(10959197, "iris.rds") +print(file_path) delete_mirror(10959197) +file.exists(file_path) \dontshow{\}) # examplesIf} } diff --git a/man/download_deposit.Rd b/man/download_deposit.Rd index ce4cc80..83fd1fb 100644 --- a/man/download_deposit.Rd +++ b/man/download_deposit.Rd @@ -26,5 +26,7 @@ Download files from a Zenodo deposit res <- list_deposit(deposit_id = 10959197) temp_dir <- tempdir() download_deposit(list_deposit = res, dest = temp_dir, quiet = FALSE) +file.exists(file.path(temp_dir, "iris.rds")) +file.exists(file.path(temp_dir, "mtcars.rds")) \dontshow{\}) # examplesIf} }