使用 sysFile 命令来执行文件上的常用文件系统操作。
目标 | 使用该命令 |
---|---|
删除文件 |
sysFile -delete “文件名” |
重命名文件 |
sysFile -rename “文件名”“新名称” |
移动文件 |
sysFile -move “文件名”“新名称” (与重命名相同。) |
复制文件 |
sysFile -copy “文件名”“新名称” |
// 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