AnsweredAssumed Answered

AEL and OS detection: How to?

Question asked by Toby on Sep 14, 2016
Latest reply on Sep 14, 2016 by Toby

Hi,

I have some AEL code, which interacts a lot with the underlying OS. It currently runs on Windows and I'd like to port it to Linux. But I'd like to maintain a single file, which is "smart" and picks the right calls dynamically.
So, what's the best/stable way to detect the OS in AEL?

I couldn't find a dedicated function and it looks like a getsysenv() call is required.

But what's a reliable system environment variable to test for to distinguish UNIX vs. Windows?

It's easy to pick one on my systems, but is this solution going to work on other installations, too?

Any suggestions?

 

Regards,

Toby

Outcomes