xcp_d.utils.filemanip.on_cifs

xcp_d.utils.filemanip.on_cifs(fname)[source]

Check whether a file path is on a CIFS filesystem mounted in a POSIX host.

On Windows, Docker mounts host directories into containers through CIFS shares, which has support for Minshall+French symlinks, or text files that the CIFS driver exposes to the OS as symlinks. We have found that under concurrent access to the filesystem, this feature can result in failures to create or read recently-created symlinks, leading to inconsistent behavior and FileNotFoundError.

This check is written to support disabling symlinks on CIFS shares.

Parameters:

fname (str) – The file to be checked.

Returns:

Either returns “cifs” if the file is on a CIFS filesystem or False if not.

Return type:

bool or str