Allow paths to be created if they don't exist

A module can now declare a path parameter for a directory that does not
yet exist. If the directory does not exist, MaxScale will create the
directory with the requested permissions.
This commit is contained in:
Markus Mäkelä
2017-04-20 12:53:17 +03:00
parent e4941044aa
commit 5704ae5ffd
4 changed files with 43 additions and 7 deletions

View File

@ -181,13 +181,16 @@ MXS_MODULE* MXS_CREATE_MODULE()
"binlogdir",
MXS_MODULE_PARAM_PATH,
NULL,
MXS_MODULE_OPT_PATH_R_OK
MXS_MODULE_OPT_PATH_R_OK |
MXS_MODULE_OPT_PATH_CREAT
},
{
"avrodir",
MXS_MODULE_PARAM_PATH,
MXS_DEFAULT_DATADIR,
MXS_MODULE_OPT_PATH_W_OK
MXS_MODULE_OPT_PATH_R_OK |
MXS_MODULE_OPT_PATH_W_OK |
MXS_MODULE_OPT_PATH_CREAT
},
{"source", MXS_MODULE_PARAM_SERVICE},
{"filestem", MXS_MODULE_PARAM_STRING, BINLOG_NAME_ROOT},