Skip to content

Commit

Permalink
Refs #75, #92. CT: create a symlink after moving intermediate results…
Browse files Browse the repository at this point in the history
… from fast disk to output dir
  • Loading branch information
yxqd committed Jan 20, 2018
1 parent 5e35f1d commit f9ee4ff
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/imars3d/CT.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,11 @@ def recon(self,
if self.clean_intermediate_files == 'archive':
import datetime
now = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
shutil.move(workdir, os.path.join(outdir, 'work-%s' % now))
newpath = os.path.join(outdir, 'work-%s' % now)
shutil.move(workdir, newpath)
# create a soft link so that the intermediate data can still be accessed
# from the CT object
os.symlink(newpath, workdir)
elif self.clean_intermediate_files == 'on_the_fly':
shutil.rmtree(workdir)
return
Expand Down

0 comments on commit f9ee4ff

Please sign in to comment.