[GRASS5] raster file history question

Markus Neteler neteler at itc.it
Thu Apr 4 10:54:39 EST 2002


On Thu, Apr 04, 2002 at 07:27:13AM -0800, Eric G. Miller wrote:
> On Thu, Apr 04, 2002 at 02:10:48PM +0200, Markus Neteler wrote:
> > On Thu, Apr 04, 2002 at 12:32:19PM +0200, Bernhard Reiter wrote:
> > > On Wed, Apr 03, 2002 at 06:29:37PM +0200, Markus Neteler wrote:
> > > > for a few modules I would like to add the feature that
> > > > the invoking command lines is stored into the raster file history.
> > > > 
> > > > It will be trivial, but I don't get the command line into
> > > > a string.
> > > 
> > > Maybe it is just me, but I don't understand the question.
> > 
> > Ok, sorry for boing unclear. A new try:
> > 
> > I want to store the command line, which was used to start a
> > module, into the history section of data.
> > 
> > Example: I run
> > 
> > r.proj dgm1km loc=europa map=europa
> > When I now run
> > 
> >  r.info dgm1km
> > 
> > the string "r.proj dgm1km loc=europa map=europa" should appear in
> > the history. This is implemented in r.slope.aspect and s.surf.rst,
> > but more complicated there. For my module (not r.proj) the command line
> > string is sufficient to later remember the parameters which I used to
> > generate that particular map.
> > 
> > It must be something with argv[] or so.
> 
> The developer's guide says programs need not be concerned about the
> history file.  Also, says the history mechanism is in need of an
> overhaul.  On quick inspection of the struct, all I can say is there'd
> be no easy way to just append a line to an existing history.  You'd
> have to go through each line looking for an opening.  Also, it's
> possible a command would be longer than RECORD_LEN, so would need to
> be split across lines.

... all this code I have already written. I only don't know how to
catch the command line. It must be possible as the parser does the
same (catching the command line).

I know that the history mechanism is poor, but for some reason I
have to store the CMD line along with the data.

Thanks,

 Markus



More information about the grass-dev mailing list