Note that there are some explanatory texts on larger screens.

plurals
  1. PORapidXML does not parse when called with script
    text
    copied!<p>I have a folder being watched with iNotify. When a file is created in the folder, the watcher takes the file, renames it (with mv), and then moves it to another folder. A RapidXML program is then called with a bash script and is suppose to parse the XML contents of the file. The iNotify program is also restarted after the RapidXML program script call.</p> <p>So, when I run the RapidXML program by itself, it parses the file and does everything it should. BUT, when I run the watcher and a XML file is placed in the watch directory, it is detected, it gets renamed, it gets moved but the RapidXML program freezes or kicks out (not sure which one) at the </p> <pre><code>doc.parse&lt;0&gt;(&amp;buffer[0]); </code></pre> <p>line.</p> <p>Here is a section my code for the RapidXML program:</p> <pre><code>#include "xmlparser.h" using namespace std; using namespace rapidxml; int main(int argc, char * argv[]) { //variable declaration left out for space purposes xml_document&lt;&gt; doc; xml_node&lt;&gt; * root_node; ifstream theFile("config.xml"); vector&lt;char&gt; buffer((istreambuf_iterator&lt;char&gt;(theFile)), istreambuf_iterator&lt;char&gt;()); buffer.push_back('\0'); doc.parse&lt;0&gt;(&amp;buffer[0]); // find the root node root_node = doc.first_node("configuration"); // iterate over the deltas xml_node&lt;&gt; * deltas_node = root_node-&gt;first_node("deltas"); svn = boost::lexical_cast&lt;double&gt;(deltas_node-&gt;first_attribute("svn")-&gt;value()); svd = boost::lexical_cast&lt;double&gt;(deltas_node-&gt;first_attribute("svd")-&gt;value()); ... //other variable assignments xml_node&lt;&gt; * report_node = deltas_node-&gt;next_sibling("report"); optime = boost::lexical_cast&lt;int&gt;(report_node-&gt;first_attribute("optime")-&gt;value()); opstatusa = boost::lexical_cast&lt;int&gt;(report_node-&gt;first_attribute("opstatusa")-&gt;value()); ... // other variable assignments xml_node&lt;&gt; * timing_node = report_node-&gt;next_sibling("timing"); timing = boost::lexical_cast&lt;int&gt;(timing_node-&gt;first_attribute("timing")); ... // then I do some SQL stuff with the mysql cpp connector. </code></pre> <p>Anyone know why it does not want to parse the XML file when called with a script?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload