[GRASS-dev] Re: testing native winGRASS

Glynn Clements glynn at gclements.plus.com
Fri Mar 16 23:25:54 EDT 2007


Paul Kelly wrote:

> >> general/g.setproj/get_stp.c:198&315:			G_system(buff);
> >> sprintf(buff,"%s \"%s\" 1>&2", pager, G_convert_dirseps_to_host(Tmp_file1));
> >
> > 	G_spawn(pager, pager, G_convert_dirseps_to_host(Tmp_file1), NULL);
> > or:
> > 	G_spawn_ex(pager, pager, G_convert_dirseps_to_host(Tmp_file1), SF_REDIRECT_DESCRIPTOR, 1, 2, NULL);
> 
> I don't think this will work on Windows - there GRASS_PAGER is "more" 
> which is a cmd.exe built-in rather than a separate command - therefore we 
> still need to call G_system() which will run the command using cmd.exe /c 
> on Windows (or /bin/sh -c on Unix).

In that case, we need to point GRASS_PAGER at a batch file which
invokes "more". We shouldn't be using a shell because $GRASS_PAGER
*might* be a shell built-in.

> >> lib/vask/V_clear.c:63:	system("clear");
> >
> > Commented out.
> 
> Note that there is G_clear_screen() if needed.

In that case, it should replace all occurrences of system("clear"). 
And it should be changed to use G_spawn(); no need for a shell (unless
"cls" is a shell built-in on Windows).

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




More information about the grass-dev mailing list