|View script||License||Download documentation as: HTML or editable|
|Download script||History||Other scripts by: peterwood|
24-Nov 23:17 UTC
Script Library: 1213 scripts
Documentation for: environ.r
environ.r is a simple script that decodes the Rebol version number (in system/version) to provide information that should be of use in multi-platform scripts. The script makes an object environ which contains five functions: os? returns a string indicating the operating system for operating systems commonly targeted for multi-platform scripts. It returns "other" for less commonly targeted platforms. usage: if environ/os? = "mac" [call "chmod 775 my-cgi.r"] nix? returns true for unix-based operating systems. usage: if environ/nix? [call "chmod 775 my-cgi.r"] win32? returns true for windows 32 operating systems usage: if environ/win32? [my-win32-api-call] win? returns true for windows 32 and CE operating systems usage: if environ/win? [call "copy %myimportantfile %../backup] cpu? returns a string of the processor usage: if environ/cpu? = "x86" [refresh-rate: 10] Note: False results will be returned if rebol is being run under an emulator such as Wine on Linux as the results are based upon decoding the version of Rebol that is running.