Eyeon:Script/Reference/Libraries/os/getenv
From VFXPedia
< Eyeon:Script | Reference | Libraries | os
Contents |
OS : os.getenv
Arguments
os.getenv( envname )
- envname (required, string)
the name of the process environment variable to retrieve.
Returns
The value of the environment variable specified as an argument, or nil if that variable does not exit.
Remarks
This function returns the value of an environment variable from the machine running the script. To obtain the value of an environment variable from a remote machine, see the fusion:GetEnv() function.
Requirements
- eyeonScript 5.0
- Fusion 5.0
Examples
function GetFusion() -- can we find the environment variable local fupath = os.getenv("FUSION_LOCATION") if fupath == nil then print("environment variable FUSION_LOCATION is not defined.") os.exit(2001) end if fileexists(fupath) == nil then print("FUSION_LOCATION does not point to a valid file.") os.exit(2002) end if os.executebg(fupath) then while fusion == nil do wait(1) fusion = Fusion() -- this needs a time-out of sort -- to avoid infinite loops end end return fusion end