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

Synopsis

sysFile [-copy string] [-delete] [-makeDir] [-move string] [-removeEmptyDir] [-rename string] string

sysFile is undoable, NOT queryable, and NOT editable.

This command provides a system independent way to create a directory or to rename or delete a file.

Return value

booleanTrue if successful, false otherwise.

Related

getFileList

Flags

copy, delete, makeDir, move, removeEmptyDir, rename
Long name (short name) Argument types Properties
-copy(-cp) string create
Copy the file to the name given by the newFileName paramter.
-delete(-del) create
Deletes the file.
-makeDir(-md) create
Create the directory path given in the parameter. This will create the entire path if more than one directory needs to be created.
-move(-mov) string create
Behaves identically to the -rename flag and remains for compatibility with old scripts
-removeEmptyDir(-red) create
Delete the directory path given in the parameter if the directory is empty. The command will not delete a directory which is not empty.
-rename(-ren) string create
Rename the file to the name given by the newFileName parameter.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can be used more than once in a command.

MEL examples

  // Create a new directory path
  sysFile -makeDir "C:/temp/mayaStuff"; // Windows
  sysFile -makeDir "/tmp/mayaStuff";      // Unix


  // Move a scene to the new directory (we can rename it at the same time).
  sysFile -rename "C:/temp/mayaStuff/myScene.mb.trash"
      "C:/maya/projects/default/scenes/myScene.mb"; // Windows
  sysFile -rename "/tmp/mayaStuff/myScene.mb.trash"
      "/maya/projects/default/scenes/myScene.mb";        // Unix

  // Rename the scene to "myScene.will.be.deleted"
  sysFile -rename "C:/temp/mayaStuff/myScene.will.be.deleted"
      "C:/temp/mayaStuff/myScene.mb.trash";           // Windows
  sysFile -rename "/tmp/mayaStuff/myScene.will.be.deleted"
      "/tmp/mayaStuff/myScene.mb.trash";                 // Unix

  // Copy a scene to the new directory
string $destWindows = "C:/temp/mayaStuff/myScene.mb.trash";
string $srcWindows = "C:/maya/projects/default/scenes/myScene.mb";
  sysFile -copy $destWindows $srcWindows;         // Windows

string $destUnix = "/tmp/mayaStuff/myScene.mb.trash";
string $srcUnix = "maya/projects/default/scenes/myScene.mb";
  sysFile -copy $destUnix $srcUnix;         // Unix

  // Delete the scene
  sysFile -delete "C:/temp/mayaStuff/myScene.will.be.deleted"; // Windows
  sysFile -delete "/tmp/mayaStuff/myScene.will.be.deleted";       // Unix