[GRASS-dev] i.rectify should test for illegal file names before launching rectification

Glynn Clements glynn at gclements.plus.com
Mon Nov 5 16:24:44 EST 2007


Moritz Lennert wrote:

> >> If you give an illegal output name to i.rectify, this is only tested
> >> after rectification. This should be done before in order to have to wait
> >> for the whole process to finish to then notice it won't work.
> >>   
> > Right - I guess
> >  G_legal_filename()
> > at the beginning would do the job.
> 
> Yes, just make sure to check the given output filename + the given 
> extension.

Oh; you're talking about illegal *file* names (as opposed to map
names)?

I don't think that we have a check for that.

Actually, the only reliable way to check whether a filename is legal
is to actually create the file. That should also ensure that creation
doesn't fail for other reasons (permissions, read-only filesystem,
etc).

> BTW anyone know how to give an empty extension in the tcltk gui ? On the 
> command line I can use extension="", but in the gui I get an error 
> because of an illegal ".

On the command line, using:

	extension=""

is the same as using just:

	extension=

The quotes are removed by the shell.

More generally, Tcl requires any quotes to go around the entire
"word", so a command line argument such as:

	text="hello world"

would need to be entered as 

	"text=hello world"
or:
	{text=hello world}

in Tcl.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list