[rrd-users] Re: C API problem (rrd_update)

Frank Swasey Frank.Swasey at uvm.edu
Wed Jan 23 14:31:27 MET 2002


I don't know if this will help you, but it was the key to being able to
call rrd_graph multiple times from the same program.

Try setting "optind" to 0 between calls (of course you will have to
#include <getopt.h> to have optind defined properly).

One of the side effects of the rrdX interfaces using getopt is that your
arguments get reordered, with all the flags first and the parameters
afterwards... so when you call the first time the arguments get
reordered to

rrdupdate -t 10... file.rrd tstamp:data  (real values of course, my
memory is not photographic).

So, when you update argv[3] you are replacing the filename instead of
the argument to -t (like you are thinking you are doing).

So, you will also need to reorder your parameters to make sure that all
your flags (like -t) are in the correct order when you call to avoid the
reordering of your parameters (or take the performance penalty of
completely filling all the argv values between calls).

-- 
Frank Swasey                    | http://www.uvm.edu/~fcs
Systems Programmer              | Always remember: You are UNIQUE,
University of Vermont           |    just like everyone else.
                    === God Bless Us All ===


--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list