Temporarily redirects to a working folder, pulling
and pushing needed files
Example:
folder = 'temp'
pull = ['file1.txt','file2.txt']
link = ['file3.big']
force = True
# original path
import os
print os.getcwd()
# enter folder
with SU2.io.redirect_folder(folder,pull,link,force) as push:
print os.getcwd()
# code
push.append('file4.txt')
#: with folder redirection
# returned to original path
print os.getcwd()
Inputs:
folder - working folder, relative or absolute
pull - list of files to pull (copy to working folder)
link - list of files to link (symbolic link in working folder)
force - True/False overwrite existing files in working folder
Targets:
push - list of files to push (copy to originating path)
Notes:
push must be appended or extended, not overwritten
links in Windows not supported, will simply copy