I would like to know if there is a function in order to understand if the program runs over Windows or Unix ?
Thanks
Printable View
I would like to know if there is a function in order to understand if the program runs over Windows or Unix ?
Thanks
Not really. See, Unix and Windows have quite different APIs, so in general, if you actually need any platform-specific functionality, you have to make the distinction at compile time anyway.
Furthermore, Unix and Windows use different executable formats, so you need the distinction at compile time even for programs relying only on the standard library.
So there's really no point in finding this out at runtime.
If you can execute a program on Windows, it's running on Windows; if you can execute it on UNIX, it's running on UNIX. You cannot run a program on multiple platforms. For that you need something like Java.