CMS 3D CMS Logo

Functions

copyFiles Namespace Reference

Functions

def main

Function Documentation

def copyFiles::main ( )

Definition at line 5 of file copyFiles.py.

00006           :
00007     if len(sys.argv) < 3:
00008         error = "Usage: copyFiles.py fromDir destDir (optional filter)"
00009         exit(error)
00010     fromDir = sys.argv[1]
00011     print fromDir
00012     if (fromDir[len(fromDir)-1] != '/'):
00013         fromDir += '/'
00014     destDir = sys.argv[2] + "/"
00015     filter = ""
00016     if len(sys.argv) > 3:
00017         filter = sys.argv[3]
00018     fileList = ls(fromDir,filter)
00019     copiedFiles = cp(fromDir,destDir,fileList)
00020 
00021     if len(copiedFiles) != len(fileList):
00022         error = "ERROR: I couldn't copy all files from " + fromDir
00023         exit(error)