Skip to content

Commit a4dd608

Browse files
committed
DOC: Update documentation
Remove unnecessary optimization
1 parent dafb5ee commit a4dd608

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

nipype/utils/filemanip.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def hash_timestamp(afile):
239239

240240

241241
def _generate_cifs_table():
242-
"""Construct a reverse-length ordered list of mount points that
242+
"""Construct a reverse-length-ordered list of mount points that
243243
fall under a CIFS mount.
244244
245245
This precomputation allows efficient checking for whether a given path
@@ -258,8 +258,6 @@ def _generate_cifs_table():
258258
key=lambda x: len(x[0]),
259259
reverse=True)
260260
cifs_paths = [path for path, fstype in mount_info if fstype == 'cifs']
261-
if cifs_paths == []:
262-
return []
263261

264262
return [mount for mount in mount_info
265263
if any(mount[0].startswith(path) for path in cifs_paths)]
@@ -269,14 +267,19 @@ def _generate_cifs_table():
269267

270268

271269
def on_cifs(fname):
272-
""" Checks whether a PATH is on a CIFS filesystem mounted in a POSIX
273-
host (i.e., has the "mount" command).
270+
""" Checks whether a file path is on a CIFS filesystem mounted in a POSIX
271+
host (i.e., has the ``mount`` command).
272+
273+
On Windows, Docker mounts host directories into containers through CIFS
274+
shares, which has support for Minshall+French symlinks, or text files that
275+
the CIFS driver exposes to the OS as symlinks.
276+
We have found that under concurrent access to the filesystem, this feature
277+
can result in failures to create or read recently-created symlinks,
278+
leading to inconsistent behavior and ``FileNotFoundError``s.
274279
275-
CIFS shares are how Docker mounts Windows host directories into containers.
276-
CIFS has partial support for symlinks that can break, causing misleading
277-
errors, so this test is used to disable them on such systems.
280+
This check is written to support disabling symlinks on CIFS shares.
278281
"""
279-
# Only the first match counts
282+
# Only the first match (most recent parent) counts
280283
for fspath, fstype in _cifs_table:
281284
if fname.startswith(fspath):
282285
return fstype == 'cifs'

0 commit comments

Comments
 (0)