R/testdirok.R

Defines functions testdirok

testdirok <- function(applib){
  #create the applib if it does not exists yet
  if(!isTRUE(file.info(applib)$isdir)){
    if(!dir.create(applib, recursive=TRUE, showWarnings=FALSE)){
      return(FALSE);
    }
  }
  #test if we can create subdirectories
  testdir <- tempfile(pattern="test", tmpdir=applib);
  if(!file.create(testdir, showWarnings = FALSE)){
    return(FALSE)
  };
  file.remove(testdir);
  return(TRUE)
}
jeroenooms/apps documentation built on May 17, 2017, 6:17 p.m.