CMS 3D CMS Logo

Functions
copyFiles Namespace Reference

Functions

def main ()
 

Function Documentation

def copyFiles.main ( )

Definition at line 5 of file copyFiles.py.

References SimDataFormats::CaloAnalysis.cp, cmsRelvalreport.exit, and eostools.ls().

5 def main():
6  if len(sys.argv) < 3:
7  error = "Usage: copyFiles.py fromDir destDir (optional filter)"
8  exit(error)
9  fromDir = sys.argv[1]
10  print fromDir
11  if (fromDir[len(fromDir)-1] != '/'):
12  fromDir += '/'
13  destDir = sys.argv[2] + "/"
14  filter = ""
15  if len(sys.argv) > 3:
16  filter = sys.argv[3]
17  fileList = ls(fromDir,filter)
18  copiedFiles = cp(fromDir,destDir,fileList)
19 
20  if len(copiedFiles) != len(fileList):
21  error = "ERROR: I couldn't copy all files from " + fromDir
22  exit(error)
23 
def main()
Definition: copyFiles.py:5
def ls(path, rec=False)
Definition: eostools.py:348