Hamish wrote: > > That's not good for the GUI, where the module won't have a > > stdin (ideally, it will have been closed; if not, the module > > will hang, waiting to read from whatever its stdin happens > > to be). > > does isatty(0) work on ms windows?
Yes. But only the Windows console is a TTY, MSys' rxvt isn't (which is why e.g. tclsh and python don't work as expected there). Windows doesn't appear to have anything similar to ptys. > does it work from a pipe? A pipe isn't considered a TTY on any platform. isatty() is frequently misused. It can be a useful heuristic to determine whether the program is being run interactively, but (as with most heuristics), there should be a way for the user to override it. The only situation where behaviour should depend solely upon the result of isatty() is if you need to rely upon TTY-specific functionality, e.g. tcsettattr(). -- Glynn Clements <[email protected]> _______________________________________________ grass-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-dev
