Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Button handy
blanktrue
color#0052CC
nameSend Feedback
linkhttps://docs.google.com/forms/d/e/1FAIpQLScmToBe3vynAlb5fdKwCGxYqnTbDc66sIBgeecG2BuFDuHc7g/viewform?entry.2002826954=Move+a+SIL+directory+-+1222738303
widthauto

Excerpt

A utility that will move a directory of SIL scripts to another directory.

...

Code Block
/**
* Moves a file(s)/directory to a new location
* @author Tim Reiking
* @date   2020/4/8
*/

string dirName = "";                    // The destination directory within the main directory
string[] sources = "";                  // An array of files and directories to move

string path = silEnv("sil.home")+"/";   // Main directory
string dest = path+dirName;             // The full path
runnerLog(dest);

for(string source in sources) {
    source = path+source;
    
    runnerLog(source);
    if(directoryExists(dest) && (directoryExists(source) || fileExists(source))) {
        runnerLog("Moving...");
        system("mv "+source+" "+dest);
    }
}
We've encountered an issue exporting this macro. Please try exporting this page again later.