[GRASS5] Re: [bug #1231] (grass) g.copy bug: cell_misc ignored

Glynn Clements glynn.clements at virgin.net
Wed Aug 14 17:23:02 EDT 2002


Markus Neteler wrote:

> > > GRASS:~ >l ~/grassdata/pat/PERMANENT/cell_misc/test
> > > ls: /ssi0/ssi/neteler/grassdata/pat/PERMANENT/cell_misc/test: No such file or
> > > directory
> > 
> > Er, shouldn't this be "modis" instead of "PERMANENT"?
> 
> Er, yes. Sorry, but....
>  
> > AFAICT, g.copy *does* copy the cell_misc/<map> directory (assuming
> > that it's in etc/element_list).
> 
> You are right. The problem is still there, but different:
> 
> 
> GRASS:~ > l /ssi0/ssi/neteler/grassdata/pat/neteler/cell_misc/test
> total 4
> -r--r--r--    1 neteler  ssi            10 Aug 14 14:25 range
> ^^^
> 
> GRASS:~ > r.support -r test
>    Updating the stats for [test]
>  WARNING: can't write range file for [test in neteler]
>    Updating the number of categories for [test]
> 
> The permissions should be
> -rw-r--r--
> 
> right? That's the real problem where I was struggling.

I suspect that adding:

    chmod u+rw $b

after the line:

    cp $a $b

in src/general/manage/lib/copy.sh should solve the immediate problem.

However, this wouldn't be specific to the cell_misc files. AFAICT, all
files retain their permissions when copied. The obvious question is:
why was the original range file read-only?

Also, that script (in fact, almost *every* script) should really have
double quotes around all of the variable expansions, i.e.

    cp "$a" "$b"

This particular issue is likely to be the source of around half of the
bugs relating to spaces in pathnames. The other half are due to the
use of sprintf/system.

In the longer term, src/general/manage should be completely
re-written. Much of the code there is suspect, even by GRASS'
standards.

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-dev mailing list