Skip to content

Commit

Permalink
Merge pull request #33 from eliansoutu/main
Browse files Browse the repository at this point in the history
actualizo write file srv
  • Loading branch information
eliansoutu authored Mar 22, 2024
2 parents 2ef6e2d + d339b8a commit 0c7c9c8
Showing 1 changed file with 37 additions and 34 deletions.
71 changes: 37 additions & 34 deletions R/write_file_srv.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ write_file_srv <- function(x, ruta, ...) {

if(Sys.info()["nodename"] != "dev-rstudio-vra-ubuntu") {

check <- paste0("/srv/DataDNMYE/", ruta) %in% herramientas::ls_srv(sub("/[^/]+$", "", ruta))

if (check == TRUE) {

user_response <- readline(prompt="El archivo ya existe. Desea sobreescribirlo? (si/no): ")

} else {

user_response <- "si"

}

if (user_response == "si") {
# check <- paste0("/srv/DataDNMYE/", ruta) %in% herramientas::ls_srv(sub("/[^/]+$", "", ruta))
#
# if (check == TRUE) {
#
# user_response <- readline(prompt="El archivo ya existe. Desea sobreescribirlo? (si/no): ")
#
# } else {
#
# user_response <- "si"
#
# }

#if (user_response == "si") {

temp_file <- tempfile()

Expand Down Expand Up @@ -76,29 +76,30 @@ write_file_srv <- function(x, ruta, ...) {

message("Escritura realizada")

} else {

message("Escritura cancelada")

}
# }
# else {
#
# message("Escritura cancelada")
#
# }

} else {

ruta <- paste0("/srv/DataDNMYE/",ruta)

check <- file.exists(ruta)

if (check == TRUE) {

user_response <- readline(prompt="El archivo ya existe. Desea sobreescribirlo? (si/no): ")

} else {
# check <- file.exists(ruta)
#
# if (check == TRUE) {
#
# user_response <- readline(prompt="El archivo ya existe. Desea sobreescribirlo? (si/no): ")
#
# } else {
#
# user_response <- "si"
#
# }

user_response <- "si"

}

if (user_response == "si") {
#if (user_response == "si") {


if (ext == "csv") {
Expand Down Expand Up @@ -132,11 +133,13 @@ write_file_srv <- function(x, ruta, ...) {
}
message("Escritura realizada")

} else {

message("Escritura cancelada")
#}

}
# else {
#
# message("Escritura cancelada")
#
# }

}

Expand Down

0 comments on commit 0c7c9c8

Please sign in to comment.