[GRASS-user] v.to.rast in a python loop, error

Glynn Clements glynn at gclements.plus.com
Mon Feb 13 17:30:25 EST 2012

Hamish wrote:

> anyone know if python has a portable version of 'sync' from linux, and/or 'wait' from bash?

There is no reason to use 'sync' or an equivalent. sync causes
modified cache blocks to be written to the underlying block device. As
processes read from the cache (not the physical device), the only
observable effect of sync is upon timings (by getting pending I/O
operations out of the way, subsequent operations face less contention
for I/O bandwidth).

bash's "wait" command is only relevant if a process is being run in
the background.

run_command, write_command, read_command and parse_command all wait
for the process to finish. start_command, pipe_command, and
feed_command return a Popen object, on which you can call the .wait()
method to wait for termination (but you shouldn't do this until after
you have closed stdin and/or received EOF on stdout, otherwise it may

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-user mailing list