use catdb/ not cat/

This commit is contained in:
mwells 2013-10-04 22:39:41 -06:00
parent 71d5d05f7c
commit d464066da4
5 changed files with 98 additions and 71 deletions

View File

@ -862,7 +862,7 @@ bool Categories::getTitleAndSummary ( char *urlOrig,
// . open the file
char filename[512];
sprintf(filename, "%scat/%s", g_hostdb.m_dir, RDFCONTENT_FILE);
sprintf(filename, "%scatdb/%s", g_hostdb.m_dir, RDFCONTENT_FILE);
//m_rdfStream.clear();
//m_rdfStream.open(filename, ifstream::in);
m_rdfStream = open(filename, O_RDONLY | O_NONBLOCK);
@ -1053,9 +1053,9 @@ long Categories::generateSubCats ( long catid,
// get the file offset
fileOffset = m_cats[catIndex].m_structureOffset;
// open the structure file
// cat/content.rdf.u8 in utf8
// catdb/content.rdf.u8 in utf8
char filename[512];
sprintf(filename, "%scat/%s", g_hostdb.m_dir, RDFSTRUCTURE_FILE);
sprintf(filename, "%scatdb/%s", g_hostdb.m_dir, RDFSTRUCTURE_FILE);
//m_rdfStream.clear();
//m_rdfStream.open(filename, ifstream::in);
m_rdfStream = open(filename, O_RDONLY);
@ -1333,7 +1333,7 @@ bool Categories::loadLangTables(void) {
unsigned long entries = 0L;
char *cp;
char *cpEnd = line + 10239;
if(!(content = fopen("cat/content.rdf.u8", "r"))) {
if(!(content = fopen("catdb/content.rdf.u8", "r"))) {
log(LOG_INFO, "cat: could not open content file.\n");
return(false);
}

View File

@ -58,9 +58,9 @@ bool Msg2a::makeCatdb( char *coll,
char inFile[256];
// url info (content) file
if ( m_updateFromNew )
sprintf(inFile, "%scat/gbdmoz.content.dat.new", g_hostdb.m_dir);
sprintf(inFile, "%scatdb/gbdmoz.content.dat.new", g_hostdb.m_dir);
else
sprintf(inFile, "%scat/gbdmoz.content.dat", g_hostdb.m_dir);
sprintf(inFile, "%scatdb/gbdmoz.content.dat", g_hostdb.m_dir);
//m_inStream.open(inFile, ifstream::in);
m_inStream = open(inFile, O_RDONLY);
//if (!m_inStream.is_open()) {
@ -118,7 +118,7 @@ bool Msg2a::makeCatdb( char *coll,
// open the new diff file
//ifstream diffInStream;
int diffInStream;
sprintf(inFile, "%scat/gbdmoz.content.dat.new.diff",
sprintf(inFile, "%scatdb/gbdmoz.content.dat.new.diff",
g_hostdb.m_dir);
//diffInStream.open(inFile, ifstream::in);
diffInStream = open(inFile, O_RDONLY);
@ -587,9 +587,9 @@ void handleRequest2a ( UdpSlot *slot, long netnice ) {
otherCategories = &g_categories1;
// load the new file
if ( updateFromNew )
sprintf(buff, "%scat/gbdmoz.structure.dat.new", g_hostdb.m_dir);
sprintf(buff, "%scatdb/gbdmoz.structure.dat.new", g_hostdb.m_dir);
else
sprintf(buff, "%scat/gbdmoz.structure.dat", g_hostdb.m_dir);
sprintf(buff, "%scatdb/gbdmoz.structure.dat", g_hostdb.m_dir);
if (otherCategories->loadCategories(buff) != 0) {
log("db: Loading Categories From %s Failed", buff);
// send error reply
@ -611,51 +611,51 @@ void handleRequest2a ( UdpSlot *slot, long netnice ) {
}
// move the current files to .old
sprintf(buff, "mv %scat/content.rdf.u8 %scat/content.rdf.u8.old",
sprintf(buff, "mv %scatdb/content.rdf.u8 %scatdb/content.rdf.u8.old",
g_hostdb.m_dir, g_hostdb.m_dir);
log ( LOG_INFO, "%s", buff);
system ( buff );
sprintf(buff, "mv %scat/structure.rdf.u8 %scat/structure.rdf.u8.old",
sprintf(buff, "mv %scatdb/structure.rdf.u8 %scatdb/structure.rdf.u8.old",
g_hostdb.m_dir, g_hostdb.m_dir);
log ( LOG_INFO, "%s", buff);
system ( buff );
sprintf(buff, "mv %scat/gbdmoz.content.dat "
"%scat/gbdmoz.content.dat.old",
sprintf(buff, "mv %scatdb/gbdmoz.content.dat "
"%scatdb/gbdmoz.content.dat.old",
g_hostdb.m_dir, g_hostdb.m_dir);
log ( LOG_INFO, "%s", buff);
system ( buff );
sprintf(buff, "mv %scat/gbdmoz.structure.dat "
"%scat/gbdmoz.structure.dat.old",
sprintf(buff, "mv %scatdb/gbdmoz.structure.dat "
"%scatdb/gbdmoz.structure.dat.old",
g_hostdb.m_dir, g_hostdb.m_dir);
log ( LOG_INFO, "%s", buff);
system ( buff );
sprintf(buff, "mv %scat/gbdmoz.content.dat.diff "
"%scat/gbdmoz.content.dat.diff.old",
sprintf(buff, "mv %scatdb/gbdmoz.content.dat.diff "
"%scatdb/gbdmoz.content.dat.diff.old",
g_hostdb.m_dir, g_hostdb.m_dir);
log ( LOG_INFO, "%s", buff);
system ( buff );
// move the .new files to current
sprintf(buff, "mv %scat/content.rdf.u8.new %scat/content.rdf.u8",
sprintf(buff, "mv %scatdb/content.rdf.u8.new %scatdb/content.rdf.u8",
g_hostdb.m_dir, g_hostdb.m_dir);
log ( LOG_INFO, "%s", buff);
system ( buff );
sprintf(buff, "mv %scat/structure.rdf.u8.new %scat/structure.rdf.u8",
sprintf(buff, "mv %scatdb/structure.rdf.u8.new %scatdb/structure.rdf.u8",
g_hostdb.m_dir, g_hostdb.m_dir);
log ( LOG_INFO, "%s", buff);
system ( buff );
sprintf(buff, "mv %scat/gbdmoz.content.dat.new "
"%scat/gbdmoz.content.dat",
sprintf(buff, "mv %scatdb/gbdmoz.content.dat.new "
"%scatdb/gbdmoz.content.dat",
g_hostdb.m_dir, g_hostdb.m_dir);
log ( LOG_INFO, "%s", buff);
system ( buff );
sprintf(buff, "mv %scat/gbdmoz.structure.dat.new "
"%scat/gbdmoz.structure.dat",
sprintf(buff, "mv %scatdb/gbdmoz.structure.dat.new "
"%scatdb/gbdmoz.structure.dat",
g_hostdb.m_dir, g_hostdb.m_dir);
log ( LOG_INFO, "%s", buff);
system ( buff );
//sprintf(buff, "mv %scat/gbdmoz.content.dat.new.diff "
// "%scat/gbdmoz.content.dat.diff",
//sprintf(buff, "mv %scatdb/gbdmoz.content.dat.new.diff "
// "%scatdb/gbdmoz.content.dat.diff",
// g_hostdb.m_dir, g_hostdb.m_dir);
//log ( LOG_INFO, "%s", buff);
//system ( buff );

View File

@ -254,7 +254,7 @@ bool Proxy::initProxy ( long proxyId, unsigned short udpPort,
g_pages.init ( );
// load up the dmoz categories here
char structureFile[256];
sprintf(structureFile, "%scat/gbdmoz.structure.dat", g_hostdb.m_dir);
sprintf(structureFile, "%scatdb/gbdmoz.structure.dat", g_hostdb.m_dir);
g_categories = &g_categories1;
if (g_categories->loadCategories(structureFile) != 0) {
log("cat: Loading Categories From %s Failed.",

File diff suppressed because one or more lines are too long

View File

@ -1381,7 +1381,7 @@ int main ( int argc , char *argv[] ) {
char structureFile[256];
g_conf.m_maxMem = 1000000000LL; // 1G
g_mem.m_maxMem = 1000000000LL; // 1G
sprintf(structureFile, "%scat/gbdmoz.structure.dat", g_hostdb.m_dir);
sprintf(structureFile, "%scatdb/gbdmoz.structure.dat", g_hostdb.m_dir);
g_categories = &g_categories1;
if (g_categories->loadCategories(structureFile) != 0) {
log("cat: Loading Categories From %s Failed.", structureFile);
@ -2833,7 +2833,7 @@ int main ( int argc , char *argv[] ) {
// load up the dmoz categories here
char structureFile[256];
sprintf(structureFile, "%scat/gbdmoz.structure.dat", g_hostdb.m_dir);
sprintf(structureFile, "%scatdb/gbdmoz.structure.dat", g_hostdb.m_dir);
g_categories = &g_categories1;
if (g_categories->loadCategories(structureFile) != 0) {
log("cat: Loading Categories From %s Failed.",
@ -4471,8 +4471,8 @@ int install ( install_flag_konst_t installFlag , long hostId , char *dir ,
if ( h2->m_hostId == 0 ) continue;
sprintf(tmp,
"rcp "
"%scat/content.rdf.u8 "
"%s:%scat/content.rdf.u8",
"%scatdb/content.rdf.u8 "
"%s:%scatdb/content.rdf.u8",
dir,
iptoa(h2->m_ip),
h2->m_dir);
@ -4480,8 +4480,8 @@ int install ( install_flag_konst_t installFlag , long hostId , char *dir ,
system ( tmp );
sprintf(tmp,
"rcp "
"%scat/structure.rdf.u8 "
"%s:%scat/structure.rdf.u8",
"%scatdb/structure.rdf.u8 "
"%s:%scatdb/structure.rdf.u8",
dir,
iptoa(h2->m_ip),
h2->m_dir);
@ -4489,8 +4489,8 @@ int install ( install_flag_konst_t installFlag , long hostId , char *dir ,
system ( tmp );
sprintf(tmp,
"rcp "
"%scat/gbdmoz.structure.dat "
"%s:%scat/gbdmoz.structure.dat",
"%scatdb/gbdmoz.structure.dat "
"%s:%scatdb/gbdmoz.structure.dat",
dir,
iptoa(h2->m_ip),
h2->m_dir);
@ -4498,8 +4498,8 @@ int install ( install_flag_konst_t installFlag , long hostId , char *dir ,
system ( tmp );
sprintf(tmp,
"rcp "
"%scat/gbdmoz.content.dat "
"%s:%scat/gbdmoz.content.dat",
"%scatdb/gbdmoz.content.dat "
"%s:%scatdb/gbdmoz.content.dat",
dir,
iptoa(h2->m_ip),
h2->m_dir);
@ -4507,8 +4507,8 @@ int install ( install_flag_konst_t installFlag , long hostId , char *dir ,
//system ( tmp );
//sprintf(tmp,
// "rcp "
// "%scat/gbdmoz.content.dat.diff "
// "%s:%scat/gbdmoz.content.dat.diff",
// "%scatdb/gbdmoz.content.dat.diff "
// "%s:%scatdb/gbdmoz.content.dat.diff",
// dir,
// iptoa(h2->m_ip),
// h2->m_dir);
@ -4521,8 +4521,8 @@ int install ( install_flag_konst_t installFlag , long hostId , char *dir ,
if ( h2->m_hostId == 0 ) continue;
sprintf(tmp,
"rcp "
"%scat/content.rdf.u8.new "
"%s:%scat/content.rdf.u8.new",
"%scatdb/content.rdf.u8.new "
"%s:%scatdb/content.rdf.u8.new",
dir,
iptoa(h2->m_ip),
h2->m_dir);
@ -4530,8 +4530,8 @@ int install ( install_flag_konst_t installFlag , long hostId , char *dir ,
system ( tmp );
sprintf(tmp,
"rcp "
"%scat/structure.rdf.u8.new "
"%s:%scat/structure.rdf.u8.new",
"%scatdb/structure.rdf.u8.new "
"%s:%scatdb/structure.rdf.u8.new",
dir,
iptoa(h2->m_ip),
h2->m_dir);
@ -4539,8 +4539,8 @@ int install ( install_flag_konst_t installFlag , long hostId , char *dir ,
system ( tmp );
sprintf(tmp,
"rcp "
"%scat/gbdmoz.structure.dat.new "
"%s:%scat/gbdmoz.structure.dat.new",
"%scatdb/gbdmoz.structure.dat.new "
"%s:%scatdb/gbdmoz.structure.dat.new",
dir,
iptoa(h2->m_ip),
h2->m_dir);
@ -4548,8 +4548,8 @@ int install ( install_flag_konst_t installFlag , long hostId , char *dir ,
system ( tmp );
sprintf(tmp,
"rcp "
"%scat/gbdmoz.content.dat.new "
"%s:%scat/gbdmoz.content.dat.new",
"%scatdb/gbdmoz.content.dat.new "
"%s:%scatdb/gbdmoz.content.dat.new",
dir,
iptoa(h2->m_ip),
h2->m_dir);
@ -4557,8 +4557,8 @@ int install ( install_flag_konst_t installFlag , long hostId , char *dir ,
system ( tmp );
sprintf(tmp,
"rcp "
"%scat/gbdmoz.content.dat.new.diff "
"%s:%scat/gbdmoz.content.dat.new.diff",
"%scatdb/gbdmoz.content.dat.new.diff "
"%s:%scatdb/gbdmoz.content.dat.new.diff",
dir,
iptoa(h2->m_ip),
h2->m_dir);
@ -4654,8 +4654,8 @@ int install ( install_flag_konst_t installFlag , long hostId , char *dir ,
if ( h2->m_hostId == 0 ) continue;
sprintf(tmp,
"rcp "
"%scat/content.rdf.u8 "
"%s:%scat/content.rdf.u8",
"%scatdb/content.rdf.u8 "
"%s:%scatdb/content.rdf.u8",
dir,
iptoa(h2->m_ipShotgun),
h2->m_dir);
@ -4663,8 +4663,8 @@ int install ( install_flag_konst_t installFlag , long hostId , char *dir ,
system ( tmp );
sprintf(tmp,
"rcp "
"%scat/structure.rdf.u8 "
"%s:%scat/structure.rdf.u8",
"%scatdb/structure.rdf.u8 "
"%s:%scatdb/structure.rdf.u8",
dir,
iptoa(h2->m_ipShotgun),
h2->m_dir);
@ -4672,8 +4672,8 @@ int install ( install_flag_konst_t installFlag , long hostId , char *dir ,
system ( tmp );
sprintf(tmp,
"rcp "
"%scat/gbdmoz.structure.dat "
"%s:%scat/gbdmoz.structure.dat",
"%scatdb/gbdmoz.structure.dat "
"%s:%scatdb/gbdmoz.structure.dat",
dir,
iptoa(h2->m_ipShotgun),
h2->m_dir);
@ -4681,8 +4681,8 @@ int install ( install_flag_konst_t installFlag , long hostId , char *dir ,
system ( tmp );
sprintf(tmp,
"rcp "
"%scat/gbdmoz.content.dat "
"%s:%scat/gbdmoz.content.dat",
"%scatdb/gbdmoz.content.dat "
"%s:%scatdb/gbdmoz.content.dat",
dir,
iptoa(h2->m_ipShotgun),
h2->m_dir);
@ -4690,8 +4690,8 @@ int install ( install_flag_konst_t installFlag , long hostId , char *dir ,
//system ( tmp );
//sprintf(tmp,
// "rcp "
// "%scat/gbdmoz.content.dat.diff "
// "%s:%scat/gbdmoz.content.dat.diff",
// "%scatdb/gbdmoz.content.dat.diff "
// "%s:%scatdb/gbdmoz.content.dat.diff",
// dir,
// iptoa(h2->m_ip),
// h2->m_dir);
@ -4705,8 +4705,8 @@ int install ( install_flag_konst_t installFlag , long hostId , char *dir ,
if ( h2->m_hostId == 0 ) continue;
sprintf(tmp,
"rcp "
"%scat/content.rdf.u8.new "
"%s:%scat/content.rdf.u8.new",
"%scatdb/content.rdf.u8.new "
"%s:%scatdb/content.rdf.u8.new",
dir,
iptoa(h2->m_ipShotgun),
h2->m_dir);
@ -4714,8 +4714,8 @@ int install ( install_flag_konst_t installFlag , long hostId , char *dir ,
system ( tmp );
sprintf(tmp,
"rcp "
"%scat/structure.rdf.u8.new "
"%s:%scat/structure.rdf.u8.new",
"%scatdb/structure.rdf.u8.new "
"%s:%scatdb/structure.rdf.u8.new",
dir,
iptoa(h2->m_ipShotgun),
h2->m_dir);
@ -4723,8 +4723,8 @@ int install ( install_flag_konst_t installFlag , long hostId , char *dir ,
system ( tmp );
sprintf(tmp,
"rcp "
"%scat/gbdmoz.structure.dat.new "
"%s:%scat/gbdmoz.structure.dat.new",
"%scatdb/gbdmoz.structure.dat.new "
"%s:%scatdb/gbdmoz.structure.dat.new",
dir,
iptoa(h2->m_ipShotgun),
h2->m_dir);
@ -4732,8 +4732,8 @@ int install ( install_flag_konst_t installFlag , long hostId , char *dir ,
system ( tmp );
sprintf(tmp,
"rcp "
"%scat/gbdmoz.content.dat.new "
"%s:%scat/gbdmoz.content.dat.new",
"%scatdb/gbdmoz.content.dat.new "
"%s:%scatdb/gbdmoz.content.dat.new",
dir,
iptoa(h2->m_ipShotgun),
h2->m_dir);
@ -4741,8 +4741,8 @@ int install ( install_flag_konst_t installFlag , long hostId , char *dir ,
system ( tmp );
sprintf(tmp,
"rcp "
"%scat/gbdmoz.content.dat.new.diff "
"%s:%scat/gbdmoz.content.dat.new.diff",
"%scatdb/gbdmoz.content.dat.new.diff "
"%s:%scatdb/gbdmoz.content.dat.new.diff",
dir,
iptoa(h2->m_ipShotgun),
h2->m_dir);