- Main Page
- Related Pages
- Modules
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Static Public Member Functions

# MCommonSystemUtils Class Reference
OpenMaya - API module for common classes

Search for all occurrences

## Detailed Description

OS functionality.

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

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.

`#include <MCommonSystemUtils.h>`

List of all members.

## Static Public Member Functions
static MString | getEnv (const MString &variable, MStatus *ResultStatus=NULL)
| This method is used to access user environment variables.
static MStatus | putEnv (const MString &variable, const MString &value)
| This method can be used to create a new environment variable or update the value of an existing environment variable.
static MStatus | makeDirectory (const MString &path)
| This method is used to create a directory.
static MStatus | getEnv (const MString &variable, MString &result)
| NO SCRIPT SUPPORT.
static const char * | className ()
| Returns the name of this class.

## Member Function Documentation

MString getEnv | ( | const MString & | variable,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | `[static]`

Search for all occurrences

This method is used to access user environment variables.

Parameters:

  [in] | variable | the user environment variable
  [out] | ReturnStatus | Status Code. See below.

Returns:
  - 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 putEnv | ( | const MString & | variable,
|  | const MString & | value
| ) |  | `[static]`

Search for all occurrences

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

Parameters:

  [in] | variable | the environment variable
  [in] | value | the value to set the environment variable to

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

MStatus makeDirectory | ( | const MString & | path | ) | `[static]`

Search for all occurrences

This method is used to create a directory.

Parameters:

  [in] | path | the path of the new directory

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

MStatus getEnv | ( | const MString & | variable,
|  | MString & | result
| ) |  | `[static]`

Search for all occurrences

NO SCRIPT SUPPORT.

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

Parameters:

  [in] | variable | the user environment variable
  [out] | result | variable value

Returns:
  - 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.

const char * className | ( |  | ) | `[static]`

Search for all occurrences

Returns the name of this class.

Returns:
  The name of this class.

MCommonSystemUtils MCommonSystemUtils MCommonSystemUtils MCommonSystemUtils MCommonSystemUtils MCommonSystemUtils MCommonSystemUtils MCommonSystemUtils MCommonSystemUtils MCommonSystemUtils
MCommonSystemUtils MCommonSystemUtils MCommonSystemUtils MCommonSystemUtils MCommonSystemUtils MCommonSystemUtils MCommonSystemUtils MCommonSystemUtils MCommonSystemUtils MCommonSystemUtils