[GRASS5] Re: [GRASSLIST:4315] Re: s.surf.rst output extent (wrap up)

Hi,

a cross-post from grasslist:
Should we consider to force a chmod to write permission enabled for user
in case a map is set to read-only (example see below)?

Markus

On Mon, Aug 19, 2002 at 10:23:08AM +0100, Thomas Dewez wrote:

Gordon and all,

After much exploration this week-end I finally discovered why the problem
was occurring: the folders tree and files were READ-ONLY !!!

This must be rare for most of you but I had copied on CD the entire
directory tree to compute the interpolation on another PC running Cygwin
and Grass5pre3. Burning data on a CD makes them "Read only". I changed the
property of the files and folders and things were back in order!

Apologies for troubling you with this silly issue, I should have thought
about it earlier...

Thank you all for your contribution

Thomas

On Mon, 19 Aug 2002, Gordon Keith wrote:

> On Thu, 15 Aug 2002 18:58, Thomas Dewez wrote:
> > Dear all,
> >
> > I am puzzled by the output extent of the s.surf.rst command and
> > perhaps one of you would know how to solve the question.
> >
> > I have a sites file containing X, Y, and Z for about 2 million points
> > (same old problem you've probably heard me moan about before). The
> > DEM output always contains the interpolation of the north eastern
> > corner of the file (1800 x 1120 cells). At first, I assumed the
> > region was set wrong. I reset the region to the extent I wanted and
> > still the output was identical.
> >
> > I'll try splitting the sites file in smaller sections but is there
> > something I'm missing?
>
> I've found the output of s.surf.rst contains values for quite a lot of
> area for which there is no data.
>
> Note the mapmask parameter to s.surf.rst.
>
> When ever I import data I use s.to.rast first on the same data to create
> a map to use as a mapmask eg:
>
>
> s.in.ascii in=accept.xyz sites=${survey}_accept
>
> s.to.rast input=${survey}_accept out=${survey}_accept
>
> s.surf.rst input=${survey}_accept elev=${survey}_bath tension=10
> zmult=-1 maskmap=${survey}_accept dmin=0.0001
>
> r.mapcalc "${survey}_bath=if(${survey}_bath < -10, ${survey}_bath,
> null())"
>
>
> The final step sets zero values to null as s.surf.rst also produces an
> interesting arrangement of zero and null values. (Note I'm working with
> mid-water bathymetry so all my values are < -10).
>
> Regards
> Gordon
>
> --
>
> Gordon Keith
> Programmer/Data Analyst
> Marine Acoustics
> CSIRO Marine Research
> http://www.marine.csiro.au
>
> /"\
> \ / ASCII Ribbon Campaign
> X Against HTML Mail
> / \
>
>

On Mon, Aug 19, 2002 at 12:28:22PM +0200, Markus Neteler wrote:

a cross-post from grasslist:
Should we consider to force a chmod to write permission enabled for user
in case a map is set to read-only (example see below)?

We should add a permission check and issue a warning.
I'm not sure that forcing a permission is a good idea.

Markus Neteler writes:
> a cross-post from grasslist:
> Should we consider to force a chmod to write permission enabled for user
> in case a map is set to read-only (example see below)?

What if it was *supposed* to be read-only? Better to say why the file
write failed. "You own that file, but you don't have write permission
for it. Consider using chmod."

--
-russ nelson http://russnelson.com |
Crynwr sells support for free software | PGPok | businesses persuade
521 Pleasant Valley Rd. | +1 315 268 1925 voice | governments coerce
Potsdam, NY 13676-3213 | +1 315 268 9201 FAX |

On Mon, Aug 19, 2002 at 10:17:55AM -0400, Russell Nelson wrote:

Markus Neteler writes:
> a cross-post from grasslist:
> Should we consider to force a chmod to write permission enabled for user
> in case a map is set to read-only (example see below)?

What if it was *supposed* to be read-only? Better to say why the file
write failed. "You own that file, but you don't have write permission
for it. Consider using chmod."

Sound's very good. Let's implement that in the libs.

Markus

Bernhard Reiter wrote:

> a cross-post from grasslist:
> Should we consider to force a chmod to write permission enabled for user
> in case a map is set to read-only (example see below)?

We should add a permission check and issue a warning.

It's better to just improve the reporting of any errors which occur.
IOW, if a system call fails, report the actual OS-level error using
perror or strerror(errno).

Trying to guess in advance whether a system call will succeed is very
difficult to get right[1]. It's a lot easier to just execute the
system call and report any errors.

[1] Actually, race conditions mean that it's impossible to get right.

I'm not sure that forcing a permission is a good idea.

Agreed.

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