In many scripting applications you have to create a directory the first time the script is run (for example, to store log files) but not on future runs of the script. Although the code to do this is simple it recurs so frequently that it is worth creating a function just to handle this task.