Jean-Luc Arnaud on Fri, 20 Sep 2024 17:19:25 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: How to determine if Windows or Mac OS


Now I know how to determine the running OS.
Unfortunately neither "uname" on Windows nor "ver" on Mac & Linux are known commands, so using them on the wrong OS results in an error message.
So, how to avoid this annoying message?

TIA

Jean-Luc

Le 20/09/2024 à 15:55, Bill Allombert a écrit :
On Fri, Sep 20, 2024 at 03:46:08PM +0200, Loïc Grenié wrote:
Le ven. 20 sept. 2024 à 14:12, Jean-Luc Arnaud <jean-luc@filmsons.com> a
écrit :

Hi all,

I'm writing GP scripts to be used on Windows or Mac OS.

Is it possible (and how) to know if the script runs on Windows or Mac OS?

     Maybe

extern("uname")
It is safer to use externstr in this case.

? externstr("uname")
%3 = ["Linux"]

Cheers,
Bill