[GRASS-dev] New wiki page summarising GRASS APIs

Glynn Clements glynn at gclements.plus.com
Mon Feb 2 04:48:09 PST 2015


Moritz Lennert wrote:

> For now, I've added a warning that you should know what you are doing if 
> you want to use these calls.

Why not just use suitable examples, e.g. using subprocess.Popen()
(without shell=True), with the caveat that on Windows it won't work
for scripts, only compiled executables.

For C, it's somewhat harder, as there isn't a mechanism for executing
commands which is standard, simple, reliable and portable. GRASS'
G_spawn* functions mostly have the last 3 (other than not working for
scripts on Windows). fork()+exec*() isn't portable or particularly
simple, but is at least standard on POSIX systems. Windows doesn't
really have anything in that regard (you have to do the quoting
yourself, and the rules differ for executables and scripts).

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


More information about the grass-dev mailing list