[GRASS-dev] g.mapsets use of sleep()
Glynn Clements
glynn at gclements.plus.com
Wed Dec 6 00:12:12 EST 2006
Hamish wrote:
> > OK, so it's not exactly "elegant", but assuming the existence of a
> > "sleep" command doesn't seem to be any more of a Unix-ism than
> > assuming the existence of an "ls" command.
>
> so #include <unistd.h> is no good in windows?
No; the header exists, but it doesn't declare sleep(). The <stdlib.h>
header declares _sleep(), although apparently this is deprecated (it
exists in the MSVCRT DLL, but isn't listed in the documentation index)
in favour of Sleep().
> isn't the system("ls") going to be a problem as well?
Only if you don't have "ls" ;)
A lot of the [G_]system and [G_]popen calls in GRASS (I count 105)
will be similarly problematic. Some will be calling GRASS programs,
but a lot use Unix commands.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list