[GRASS-dev] Re: [bug #4450] (grass) g.remove vect: empty dirs in the $MAPSET/.tmp/$HOSTNAME left

Markus Neteler neteler at itc.it
Sat Jun 17 15:00:19 EDT 2006


On Sat, Jun 17, 2006 at 07:53:29PM +0200, Maciek Sieczka wrote:
> On Sat, 17 Jun 2006 19:27:55 +0200
> Markus Neteler <neteler at itc.it> wrote:
> 
> > On Sat, Jun 17, 2006 at 07:12:10PM +0200, Maciek Sieczka wrote:
> > > On Sat, 17 Jun 2006 15:04:52 +0200 (CEST)
> > > Markus Neteler via RT <grass-bugs at intevation.de> wrote:
> > > 
> > > > On Sat, Jun 17, 2006 at 01:32:24PM +0200, Maciek Sieczka via RT
> > > > wrote:
> > > > > I have built current Grass 6.1 CVS on Ubuntu Breezy with
> > > > > http://mpa.itc.it/markus/tmp/clean_temp2.c apllied.
> > > 
> > > > > I'd prefer each such empty dir be removed right after 'g.remove
> > > > > vect'is done, but maybe this is not so critical.
> > > 
> > > > This is an issue of the program creating the vector map in
> > > > question. Which one did you use? A script, r.* or v.*?
> > > 
> > > It is 'g.remove vect' that leaves empty temp dirs in the .tmp.
> > 
> > In a sense yes: 'g.remove vect' doesn't remove the empty temp dirs 
> > in the LOCATION/MAPSET/.tmp/
> > 
> > But that's not even the idea of g.remove.
> > 
> > > As my bug report reads:
> > > 
> > > >For each vector file it removes, g.remove leaves 1 empty, redundant
> > > >directory in the $MAPSET/.tmp/$HOSTNAME.
> > > 
> > > To reproduce:
> > > 
> > > 1. Create a vector file
> > 
> > My question was: which command did you use to create a vector file?
> > That command should not leave files in .tmp/. There we have to
> > search for the problem IMHO.
> 
> And I'm telling you that command that created the temp dir, is 'g.remove
> vect'. And that it is 'g.remove vect' that is supposed to remove a 
> temporary dir, which it created.
> 
> Or did I missunderstood?

Mhh, I didn't know that g.remove creates temporal directories.
Not sure where that should happen:

grep -i mkdir */*.c
lib/do_copy.c:#define mkdir(name, mode) mkdir(name)
lib/do_copy.c:          if(mkdir(dst, mode & 0777))
lib/do_copy.c:          if(remove(dst) || mkdir(dst, mode & 0777))

  
> > > 2. Empty your $MAPSET/.tmp/$HOSTNAME entirely.
> > > 3. g.remove that vector.
> 
> > No - g.remove removes a vector map and doesn't care for tmp files.
> 
> But it should remove temp dirs which it created. Or not?

Each command who creates temp files/dirs should remove them.

Markus 




More information about the grass-dev mailing list