g.tempfile -d: make a directory not a filename
|Reported by:||hamish||Owned by:|
|Keywords:||g.tempfile, scripting, mktemp||Cc:|
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