Changeset 9210
- Timestamp:
- 2005-02-28T14:52:29+13:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/colservr/lucenesearch.cpp
r9115 r9210 34 34 35 35 #include <stdio.h> 36 #include <time.h> 36 37 37 38 #include "gsdlconf.h" … … 118 119 119 120 text_t cmd = "lucene_query.pl "; 120 cmd += indexname + (text_t)" \"" + to_utf8(queryparams.querystring) + (text_t)"\""; 121 122 #ifdef __WIN32__ 123 FILE *PIN = _popen(cmd.getcstr(), "r"); 121 cmd += indexname + (text_t)" \"" + to_utf8(queryparams.querystring) + (text_t)"\""; 122 123 text_t xml_text = ""; 124 125 #ifdef __WIN32__ 126 //FILE *PIN = _popen(cmd.getcstr(), "r"); // didn't seem to work 127 128 cmd = (text_t)"bin\\windows\\perl\\bin\\perl.exe -S "+cmd; 129 clock_t this_time = clock(); 130 text_t filename = "luc"; 131 filename.append(this_time); 132 filename.append(".txt"); 133 //cerr << "filename = "<<filename<<endl; 134 text_t out_file = filename_cat(collectdir, filename); 135 cmd += (text_t)" > "+ out_file; 136 //cerr << "cmd ="<<cmd<<endl; 137 system(cmd.getcstr()); 138 139 read_file(out_file, xml_text); 140 remove(out_file.getcstr()); // now delete it 141 142 124 143 #else 125 144 FILE *PIN = popen(cmd.getcstr(), "r"); 126 #endif 145 127 146 if (PIN==NULL) { 147 perror("PIPE"); 128 148 cerr << "Error: unable to open pipe to " << cmd << endl; 149 129 150 return false; 130 151 } 131 152 132 text_t xml_text = "";133 153 134 154 while (!feof(PIN)) { … … 138 158 } 139 159 160 #endif 140 161 expat_resultset(xml_text,queryresult); 141 162 142 163 #ifdef __WIN32__ 143 _pclose(PIN);164 // _pclose(PIN); 144 165 #else 145 166 pclose(PIN);
Note:
See TracChangeset
for help on using the changeset viewer.