View source: R/CoreFunctions.R
verifyFolder | R Documentation |
This is a helper function used in the fusionwrapr package to verify
the existence of folder
and create the folder(s) if it does not exist.
verifyFolder
is normally called with a folder extracted using
dirname()
when an output file is provided to a function. When saving commands
to a file, a command will be written to create the folder in addition to creating
the folder. This can make it easier to delete the results from a set of processing
steps and then re-run them using the command file. When saving to a command file,
there is checking to see if the folder already exists. This prevents multiple attempts
to create the same folder and any associated error or warning messages. In addition,
when saving to a command file, the path is enclosed in quotes to prevent problems
when the folder names contain spaces.
verifyFolder(
folder,
runCmd = TRUE,
saveCmd = TRUE,
cmdFile = NULL,
cmdClear = FALSE
)
folder |
folder name |
runCmd |
boolean: indicates command line should be executed. If TRUE, no
commands will be written to the batch file regardless of the value for |
saveCmd |
boolean: indicates command line the create the folder(s) should be written to a file. This command will create the folder(s) when the command file is run from a command prompt. |
cmdFile |
character: contains the name of the file to which commands should be written. |
cmdClear |
boolean: indicates file for commands should be deleted (cleared) before the command line is written. |
An (invisible) boolean TRUE, If the folder does not exist and cannot be created, execution stops.
## Not run:
verifyFolder("/test")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.