class MCommonSystemUtils

Jump to documentation

OS functionality. (OpenMaya)

public members:

static MString getEnv ( const MString &variable, MStatus *ResultStatus = NULL)
static MStatus putEnv ( const MString &variable, const MString &value )
static MStatus makeDirectory ( const MString &path )
static MStatus getEnv ( const MString &variable, MString &result )
NO SCRIPT SUPPORT

Documentation

Methods for getting and setting environment variables, make directories etc.
Description

This class provides some standard Operating System functionality that is available from MEL. These methods can be called instead of invoking MEL through the MGlobal class.

NOTE: These methods are provided as a convenience. It would be more efficient to call directly into the operating system than to use the methods of this class.

Functions

MStatus MCommonSystemUtils:: getEnv ( const MString &variable, MString &result )
Description

This method is used to access user environment variables.

Python Notes

This method is not supported in Python. Please see the one which returns a string

Arguments

  • variable the user environment variable
  • result variable value

Return Value

  • Status Code

Status Codes

  • MS::kSuccess getting the environment variable worked
  • MS::kFailure failed to get the environment variable, variable length < 1

NOTE: getting an unset environment variable will not return an error.

MString MCommonSystemUtils:: getEnv ( const MString &variable, MStatus * ReturnStatus )
Description

This method is used to access user environment variables.

Arguments

  • variable the user environment variable
  • ResultStatus Status Code. See below.

Return Value

  • the string value of the enviornment variable

Status Codes

  • MS::kSuccess getting the environment variable worked
  • MS::kFailure failed to get the environment variable, variable length < 1

NOTE: getting an unset environment variable will not return an error.

MStatus MCommonSystemUtils:: putEnv ( const MString &variable, const MString &value )
Description

This method can be used to create a new environment variable or update the value of an existing environment variable.

Arguments

  • variable the environment variable
  • value the value to set the environment variable to

Return Value

  • Status Code

Status Codes

  • MS::kSuccess setting the enviroment variable worked
  • MS::kFailure setting the environment variable failed, variable length < 1

MStatus MCommonSystemUtils:: makeDirectory ( const MString &path )
Description

This method is used to create a directory.

Arguments

  • path the path of the new directory

Return Value

  • Status Code

Status Codes

  • MS::kSuccess created new directory
  • MS::kFailure failed to create new directory( invalid path )

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright