Skip to content

Commit

Permalink
Try once more to fix the Windows download issues ...
Browse files Browse the repository at this point in the history
  • Loading branch information
RLumSK committed Apr 29, 2024
1 parent a35a125 commit f729e76
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 2 additions & 0 deletions R/internals_RLum.R
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,8 @@ fancy_scientific <- function(l) {
url = url,
destfile = destfile,
quiet = TRUE,
mode = "wb",
cacheOK = FALSE,
method = "auto"),
warning = function(w) {
message("FAILED ", appendLF = TRUE)
Expand Down
19 changes: 18 additions & 1 deletion R/read_BIN2R.R
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,24 @@ read_BIN2R <- function(


# Config --------------------------------------------------------------------------------------
##set file_link for internet downloads
url_file <- NULL
on_exit <- function(){
##unlink internet connection
if(!is.null(url_file)){
unlink(url_file)
}

##close connection
if(exists("con") && !is.null(con)){
close(con)

}


}
on.exit(expr = on_exit())

## check for URL and attempt download
if(verbose)
url_file <- .download_file(file, tempfile("read_BIN22R_FILE", fileext = ".binx"))
Expand Down Expand Up @@ -300,7 +318,6 @@ read_BIN2R <- function(
# Short file parsing to get number of records -------------------------------------------------
#open connection
con <- file(file, "rb")
on.exit(close(con))

##get information about file size
file.size <- file.info(file)
Expand Down

0 comments on commit f729e76

Please sign in to comment.