Documention for: environ.r Created by: peterwood on: 24-Dec-2006 Last updated by: peterwood on: 27-May-2008 Format: text/editable Downloaded on: 29-Mar-2024 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.