CMS 3D CMS Logo

Functions
copyFiles Namespace Reference

Functions

def main ()
 

Function Documentation

◆ main()

def copyFiles.main ( )

Definition at line 6 of file copyFiles.py.

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

References CommonMethods.cp(), beamvalidation.exit(), eostools.ls(), and edm.print().

eostools.ls
def ls(path, rec=False)
Definition: eostools.py:349
copyFiles.main
def main()
Definition: copyFiles.py:6
edm::print
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
beamvalidation.exit
def exit(msg="")
Definition: beamvalidation.py:53
CommonMethods.cp
def cp(fromDir, toDir, listOfFiles, overwrite=False, smallList=False)
Definition: CommonMethods.py:192