Am 03.03.2010 10:23, MacArthur, Ian (SELEX GALILEO, UK) wrote:
>> I tried:
>>
>> lpstat = popen("LC_MESSAGES=C lpstat -p -d", "r");
>>
>> and this worked as well. Looks much cleaner to me, because it only
>> modifies the lpstat environment. :-)
>>
>> Is this what you proposed? Any better ideas?
>
> Yes - this is what I'd seen done in the past (and then copied!)
> There may well be better ways, but that seems simple and clean to me.
Thanks for confirmation.
> I suppose we could fork off a whole new process space, putenv("stuff")
> in that, get the lpstat output, then expire the forked process space
> (thus not modifying the env for the main process) but that sounds like
> an awful lot more work to no real benefit?
KISS ;-) http://en.wikipedia.org/wiki/KISS_principle
I would more like to have an API to access defined printers etc., but
that's a dream, isn't it? I *really* don't like interpretation of other
programs' output.
Albrecht
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev