Commit 6369d1c2 authored by Claes's avatar Claes Committed by Esteban Blanc

Wb command 'create volume' for class volumes added

parent d8a928ea
......@@ -1153,6 +1153,39 @@ wb_vrep* wb_erep::createVolume(pwr_tStatus* sts, pwr_tVid vid, pwr_tCid cid,
if (add)
addDb(sts, vrepmem);
return vrepmem;
} else if (type == ldh_eVolRep_Wbl) {
char vidstr[40];
pwr_tTime t;
char classstr[40];
cdh_VolumeIdToString(vidstr, sizeof(vidstr), vid, 0, 0);
sprintf(vname, "$pwrp_db/%s.wb_load", cdh_Low(name));
dcli_translate_filename(vname, vname);
switch (cid) {
case pwr_eClass_ClassVolume:
strcpy(classstr, "$ClassVolume");
break;
case pwr_eClass_RootVolume:
strcpy(classstr, "$RootVolume");
break;
default:
*sts = LDH__NYI;
return 0;
}
if (ODD(dcli_file_time(vname, &t))) {
*sts = LDH__VOLIDALREXI;
return 0;
}
std::ofstream ofd(vname);
ofd << "Volume " << name << " " << classstr << " " << vidstr << "\n"
<< "EndVolume\n";
ofd.close();
MsgWindow::message('I', "Database created", vname);
} else if (type == ldh_eVolRep_Db) {
sprintf(vname, "$pwrp_db/%s.db", cdh_Low(name));
dcli_translate_filename(vname, vname);
......
......@@ -3625,6 +3625,8 @@ static int wnav_create_func(void* client_data, void* client_flag)
volrep = ldh_eVolRep_Db;
else if (str_NoCaseStrcmp(databasestr, "MYSQL") == 0)
volrep = ldh_eVolRep_Dbms;
else if (str_NoCaseStrcmp(databasestr, "WBLOAD") == 0)
volrep = ldh_eVolRep_Wbl;
else {
wnav->message('E', "Syntax error in database");
return WNAV__QUAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment