is.error( checkFile("FileThatDoesntExist.txt") )
checkFile("FileThatDoesntExist.txt", fun=warning)
checkFile("FileThatDoesntExist.txt", fun=message)
is.error( checkFile("FileThatDoesntExist.txt", fun=MyWarn) ) # nonexisting function
## Not run: ## Excluded from CRAN checks because of file creation
# # Vectorized:
# file.create("DummyFile2.txt")
# checkFile(paste0("DummyFile",1:3,".txt"), fun=message)
# checkFile(paste0("DummyFile",1:3,".txt") )
# file.remove("DummyFile2.txt")
# ## End(Not run)
## Not run: ## Excluded from CRAN checks because of intentional errors
# compareFiles("dummy.nonexist", "dummy2.nonexist")
# checkFile("dummy.nonexist")
#
# dingo <- function(k="brute.nonexist") checkFile(k)
# dingo()
# dingo("dummy.nonexist")
#
# upper <- function(h) dingo(c(h, "dumbo.nonexist"))
# upper("dumbo2.nonexist")
# ## End(Not run)
Run the code above in your browser using DataLab