Go to: Return value. Related commands. Flags. Examples.

Synopsis

sysFile [-delete ] [-makeDir] [-removeEmptyDir] [-rename newFileName] [-copy newFileName] file

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

Return value

true if successful, false otherwise.

Related commands

getFileList

Flags

copy, delete, makeDir, move, removeEmptyDir, rename

Long name (short name)[argument types]Properties
-delete (-del) create
Deletes the file.
-rename (-ren) stringcreate
Rename the file to the name given by the newFileName parameter.
-move (-mov) stringcreate
Behaves identically to the -rename flag and remains for compatibility with old scripts
-copy (-cp) stringcreate
Copy the file to the name given by the newFileName paramter.
-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.
-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.

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

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