mkdir function - was: Re: [GRASS-dev] Re: [GRASS-user] 'ARNing: Cannot open driver 'dbf"

Glynn Clements glynn at gclements.plus.com
Thu Dec 7 07:02:09 EST 2006


Markus Neteler wrote:

> >> in manage/lib/do_copy.c, 'mkdir' is used which IMHO needs a special
> >> treatment on Windows. See for example lib/gis/mapset_msc.c
> >>     
> >
> > here I leave this bug- I leave Windows developement as a challenge for
> > others to pursue.
> 
> There are some candidates for this fix (contains some false positives):
> 
> find . -type f -name "*.c" -exec grep -l mkdir {} \;
> ./general/manage/lib/do_copy.c
> ./raster/r.li/r.li.daemon/daemon.c
> ./raster/r.le/r.le.setup/main.c
> ./raster/r.le/r.le.patch/main.c
> ./raster/r.le/r.le.pixel/main.c
> ./lib/init/mke_mapset.c
> ./lib/init/mke_loc.c
> ./lib/db/dbmi_driver/d_mkdir.c
> ./lib/gis/make_mapset.c
> ./lib/gis/make_loc.c
> ./lib/gis/mapset_msc.c
> ./lib/gis/win32_pipes.c
> ./lib/gis/unix_socks.c
> ./lib/gis/paths.c
> ./lib/gis/user_config.c
> ./lib/raster/io_fifo.c
> ./lib/g3d/g3dwindowio.c
> ./gem/reg_entries.c
> ./gem/actions.c
> lib/gis/paths.c
> 
> Probably a search/replace of ' mkdir' would do, using G_mkdir() from
> ./lib/gis/paths.c
> ? Or we need to modify G_mkdir() to accepts two parameters.

No, G_mkdir() is fine.

On Unix, the mode argument should always be 0777, so the user has
complete control of the permissions via their umask; anything which
uses a more restrictive mode is second-guessing the user.

The only programs which should be setting permissions explicitly are
those which provide some other mechanism for the user to control the
permissions.

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




More information about the grass-dev mailing list