Added functions to try to open a DMS if it exists
This commit is contained in:
21
src/obidms.c
21
src/obidms.c
@ -362,7 +362,7 @@ OBIDMS_p obi_open_dms(const char* dms_path)
|
||||
if (realpath(complete_dms_path, dms->directory_path) == NULL)
|
||||
{
|
||||
obi_set_errno(OBIDMS_UNKNOWN_ERROR);
|
||||
obidebug(1, "\nError getting the absolute path to the DMS directory");
|
||||
obidebug(1, "\nError getting the absolute path to the DMS directory (DMS does not exist)");
|
||||
free(complete_dms_path);
|
||||
return NULL;
|
||||
}
|
||||
@ -536,6 +536,25 @@ OBIDMS_p obi_open_dms(const char* dms_path)
|
||||
}
|
||||
|
||||
|
||||
OBIDMS_p obi_test_open_dms(const char* dms_name)
|
||||
{
|
||||
int exists;
|
||||
|
||||
exists = obi_dms_exists(dms_name);
|
||||
|
||||
switch (exists)
|
||||
{
|
||||
case 0:
|
||||
return NULL;
|
||||
case 1:
|
||||
return obi_open_dms(dms_name);
|
||||
};
|
||||
|
||||
obidebug(1, "\nError checking if an OBIDMS directory exists");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
OBIDMS_p obi_dms(const char* dms_name)
|
||||
{
|
||||
int exists;
|
||||
|
Reference in New Issue
Block a user