aboutsummaryrefslogtreecommitdiff
path: root/util.R
blob: 0a87079da368fbe07d877deae50abffb79ca4dcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# util.R
#
# Assorted utilities.

# Creates a directory at given path, optionally logging the action.
# If it already exists, the directory is not created.
dir.create.safe <- function(path, log=T) {
  if (!dir.exists(path)) {
    if (log) {
      loginfo("Creating directory: %s", path)
    }

    dir.create(path)
  }
}