ディレクトリを操作する

 
 
 
目的 使用するコマンド

現在のディレクトリを変更する

chdir “パス”

ディレクトリ内のファイル名の配列を返す

getFileList

新規のディレクトリを作成する

sysFile -makeDir “ディレクトリ名”

たとえば、次のようになります。

// List the contents of the user's projects directory
getFileList -folder `internalVar -userWorkspaceDir`;
// Store all MEL files in the user's script directory
// in an array variable
string $scriptDir = `internalVar -userScriptDir`;
string $scripts[] = `getFileList -folder $scriptDir -filespec "*.mel"`;
// Create a new directory path
sysFile -makeDir "C:/temp/mayaStuff"; // Windows
sysFile -makeDir "/tmp/mayaStuff"; // Unix