[GRASS-dev] [bug #4381] (grass) export location for r.out.* differs

this bug's URL: http://intevation.de/rt/webrt?serial_num=4381
-------------------------------------------------------------------------

Subject: export location for r.out.* differs

Platform: GNU/Linux/x86
grass binary for platform: Compiled from Sources
GRASS Version: cvs today

if I start GRASS from /home/user and change the working directory afterwards
inside GRASS e.g.

mkdir new_dir
cd new_dir

called from gis.m:
r.out.gdal/r.out.bin exports to /home/user
r.out.ascii/r.out.arc/r.out.tiff exports to /home/user/new_dir

I did not check all export modules but can do it, if the error is user
independent.

A consistent behaviour would be good - I would prefer the latter behaviour
for all export functions.

Martin

-------------------------------------------- Managed by Request Tracker

called from gis.m:
r.out.gdal/r.out.bin exports to /home/user
r.out.ascii/r.out.arc/r.out.tiff exports to /home/user/new_dir

BTW

Moreover, some commands accept and some don't accept directory names in
the "output=". Eg. r.out.tiff will fail with an error if you try to
put a dir name here.

Secondly, some export modules force (well, at least r.out.tiff does)
the file extension, and some leave it up to the user to set it.

It would be great if this behaviour could be unified too.

Maciek

--------------------
W polskim Internecie s? setki milion?w stron. My przekazujemy Tobie tylko najlepsze z nich!
http://katalog.panoramainternetu.pl/

Secondly, some export modules force (well, at least r.out.tiff does)
the file extension, and some leave it up to the user to set it.

A good solution is to check to see if the name already has the extension
on it before "forcing" one on. (so you don't get .tif.tif)

shell:
FILE="`basename $output .tif`.tif"

tcl:
if { [string compare [file extension $fname] ".tif"] != 0 } then {
   append fname ".tif"
}

C:
<string.h> :slight_smile:

Hamish