This is a short post describing how to detect the system platform (Operating System) where your virtual-machine is running. You can use the following expressions in several major Smalltalk flavors:
Pharo
1 2 3 4 5 6 7 8 9 | " Pharo >= 4 " Smalltalk os isWin32. Smalltalk os isMacOS. Smalltalk os isMacOSX. Smalltalk os isUnix. " Pharo 3 " OSPlatform current isWindows. " Pharo 2 " OSPlatform isWin32. |
VisualWorks >= 7
1 | ExternalInterface currentPlatform. |
Dolphin 7
1 2 3 4 5 6 7 | OSVERSIONINFO current osName. OSVERSIONINFO current isWinV5OrLater OSVERSIONINFO current isWinV6OrLater OSVERSIONINFO current isWinVista OSVERSIONINFO current isWinXP OSVERSIONINFO current isWinXPOrLater OSVERSIONINFO current isNT |
0 comentarios:
Publicar un comentario