CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
copyFiles Namespace Reference

Functions

def main
 

Function Documentation

def copyFiles.main ( )

Definition at line 6 of file copyFiles.py.

References beamvalidation.exit(), eostools.ls(), and print().

6 
7 def main():
8  if len(sys.argv) < 3:
9  error = "Usage: copyFiles.py fromDir destDir (optional filter)"
10  exit(error)
11  fromDir = sys.argv[1]
12  print(fromDir)
13  if (fromDir[len(fromDir)-1] != '/'):
14  fromDir += '/'
15  destDir = sys.argv[2] + "/"
16  filter = ""
17  if len(sys.argv) > 3:
18  filter = sys.argv[3]
19  fileList = ls(fromDir,filter)
20  copiedFiles = cp(fromDir,destDir,fileList)
21 
22  if len(copiedFiles) != len(fileList):
23  error = "ERROR: I couldn't copy all files from " + fromDir
24  exit(error)
def ls
Definition: eostools.py:349
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def main
Definition: copyFiles.py:6