Method CreateFilePathSafe
CreateFilePathSafe(string)
Creates the directory for the specified file path if it does not already exist. This method is a safe version of CreateFilePath(string) that catches exceptions.
public static bool CreateFilePathSafe(string pathToFile)
Parameters
pathToFile
stringThe file path for which the directory should be created.
Returns
- bool
true
if the directory was successfully created or already exists; otherwise,false
if an exception occurred.