Safe Directory Handler

Often you wish to create an Output directory or suchlike within your code - but doing so is fraught with errors if the directory already exists. This makes such operations safe and secure.

Function

inline mkdirReturn JSL::mkdir(std::string directory)

Checks the status of the target directory, if it does not exist, attempts to create it. Works wherever the mkdir command is installed.

Parameters:

directory – Path (relative or absolute) to the desired directory

Returns:

A mkdirReturn object detailing the success + associated messages for the request

Return Object

struct JSL::mkdirReturn

A wrapper for the return type of mkdirSafely()

Public Members

bool Successful

True if the directory already existed, or was succesfully created.

std::string Message

Contains the logging messages from the function.