I would like to know if there is a function in order to understand if the program runs over Windows or Unix ?
Thanks
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.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
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.