File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 4
4
from collections import defaultdict
5
5
from json import dumps , loads
6
6
from pathlib import Path
7
- from shutil import copytree , rmtree
7
+ import shutil
8
8
from pkg_resources import resource_filename as _pkgres
9
9
import re
10
10
@@ -869,10 +869,15 @@ def _run_interface(self, runtime):
869
869
870
870
# Finesse is overrated. Either leave it alone or completely clobber it.
871
871
if dest .exists () and self .inputs .overwrite_fsaverage :
872
- rmtree (dest )
872
+ shutil . rmtree (dest )
873
873
if not dest .exists ():
874
874
try :
875
- copytree (source , dest )
875
+ # Use copy instead of copy2; copy calls copymode while copy2 calls
876
+ # copystat, which will preserve atime/mtime.
877
+ # atime should *not* be copied to avoid triggering processes that
878
+ # sweep un-accessed files.
879
+ # If we want to preserve mtime, that will require a new copy function.
880
+ shutil .copytree (source , dest , copy_function = shutil .copy )
876
881
except FileExistsError :
877
882
LOGGER .warning (
878
883
"%s exists; if multiple jobs are running in parallel"
You can’t perform that action at this time.
0 commit comments