[GRASS-dev] [GRASS GIS] #1902: g.tempfile -d: make a directory not a filename

GRASS GIS trac at osgeo.org
Sat Mar 2 04:13:06 PST 2013

#1902: g.tempfile -d: make a directory not a filename
 Reporter:  hamish                 |       Owner:  grass-dev@…              
     Type:  defect                 |      Status:  new                      
 Priority:  normal                 |   Milestone:  7.0.0                    
Component:  Default                |     Version:  svn-trunk                
 Keywords:  g.tempfile, scripting  |    Platform:  All                      
      Cpu:  All                    |  

 in grass7 there is a new `g.tempfile -d` flag to do a "dry run". It is
 used in core.py by grass.tempdir() to later make a directory by the
 returned string name. This has three things against it: 1) it causes a
 race condition. 2) it diverges from the usage of `/bin/mktemp -d`, which
 is used to make a directory. 3) it's a lot more convoluted than just
 making the tempfile a directory in the first place, which is the only(?)
 known use of -d for dryrun.

 I propose that the -d flag in g.tempfile be changed to match mktemp's
 usage, i.e. make a directory instead.

 It is not present in grass6, so there is not a backwards compatibility
 problem to change it now. I'd suggest that the -d flag to make a new
 directory would be useful to backport to grass6 once it is ready.


 ps- argh trac is logging out every 5 minutes again

Ticket URL: <https://trac.osgeo.org/grass/ticket/1902>
GRASS GIS <http://grass.osgeo.org>

More information about the grass-dev mailing list