Question:
I need to make some system calls in my C# applications. Unfortunately, this behaves differently on Linux than on UNIX.
Now I used to switch the Operating system at runtime like this
If Environment.OSVersion.Platform = System.PlatformID.Unix Then
' Linux/Unix '
ElseIf Environment.OSVersion.Platform = System.PlatformID.MacOSX Then
' Apple '
Else
' Windows '
End If
The problem now is I need to differentiate between UNIX and Linux, because they are different.
Is there a way I can figure out whether the OS is Linux or Unix? Preferably not by invoking uname -a
I wouldn't like to abandon Unix and make it Linux only, just because Microsoft did not add a PlatformID.Linux...