Go to: Synopsis. Return value. Related. MEL examples.

Synopsis

chdir string

chdir is undoable, NOT queryable, and NOT editable.

Causes the directory represented by the string argument to be the current working directory. An integer value of 0 is returned if the command was successful, and -1 otherwise. See also the unix function "chdir".

Return value

intError code

Related

pwd, workspace

MEL examples

chdir "/h/userName/maya/";
// Result: 0 //
chdir "..";
// Result: 0 //
pwd;
// Result: /h/userName //
chdir "fdsaf";
// Result: -1 //