ATLAS Offline Software
Functions
python.filemovemod Namespace Reference

Functions

def move_files (prefix, config)
 

Function Documentation

◆ move_files()

def python.filemovemod.move_files (   prefix,
  config 
)

Definition at line 4 of file filemovemod.py.

4 def move_files(prefix, config):
5  import os, shutil, subprocess
6 
7  filemap = config.filemap
8  if filemap == {}:
9  return
10  for src, dest in filemap.items():
11  print(src, dest)
12  if os.access(src, os.R_OK):
13  if dest.startswith('root://'):
14  try:
15  subprocess.check_call(['xrdcp', src, os.path.join(dest, prefix + '_' + os.path.basename(src))])
16  except subprocess.CalledProcessError as e:
17  print(e)
18  else:
19  try:
20  shutil.copy2(src, os.path.join(dest, prefix + '_' + os.path.basename(src)))
21  except IOError as e:
22  print(e)
23 
python.filemovemod.move_files
def move_files(prefix, config)
Definition: filemovemod.py:4
dbg::print
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
Definition: SGImplSvc.cxx:70