add checks to read/write csv and refactor

This commit is contained in:
2021-08-10 21:49:06 +02:00
parent 605e5e976a
commit 6e9fe12784
3 changed files with 18 additions and 8 deletions
+7
View File
@@ -19,6 +19,13 @@ check_directory <- function(path, create=F) {
}
}
stop_dir_not_creatable <- function(cond) {
# currently this has call: dir.create(download_dir)
# do we want to change this to fetch_all(...) ?
cond$message <- "Directory does not exist and can't be created. Probably because the path is not writeable."
stop(cond)
}
# appends a file seperator at end of path if needed
make_directory_path <- function(path) {
if (!str_ends(path, .Platform$file.sep)) str_c(path, .Platform$file.sep)