diff --git a/binarycpython/utils/dataIO.py b/binarycpython/utils/dataIO.py index e63b29996057d6138432d0eaf0846e7cc8e6b37e..71918813a1c85119fcbc1c16e6e94d3a8bfe2b0f 100644 --- a/binarycpython/utils/dataIO.py +++ b/binarycpython/utils/dataIO.py @@ -12,6 +12,7 @@ import json import msgpack import os import pathlib +import subprocess import time from typing import Union, Any @@ -734,9 +735,19 @@ class dataIO(): def NFSpath(self,path): """ Test path to see if it's on an NFS mount. - """ - if os.path.exists(path) and os.path.ismount(path): - s = os.stat(path) - print(s) - # use `stat -f -L -c %T "$_[0]"`=~/^nfs/io ? 1 : 0; + Args: + path : the path to be tested + + Returns: + True : if on an NFS mount point. + False : if not. + None : if the path does not exist. + """ + if os.path.exists(path): + cmd = 'stat -f -L -c %T "' + path + '"' + return 'nfs' in subprocess.Popen(cmd, + shell=True, + stdout=subprocess.PIPE).stdout.read().decode() + else: + return None diff --git a/binarycpython/utils/spacing_functions.py b/binarycpython/utils/spacing_functions.py index 14cab7627a4c3a6e65fc1d5d4a1cbf24c43cf29e..7b44078d7a87bc85c66a162412660338e3761831 100644 --- a/binarycpython/utils/spacing_functions.py +++ b/binarycpython/utils/spacing_functions.py @@ -339,7 +339,7 @@ class spacing_functions(): else: __decorator = __dummy_decorator - @__decorator() + @__decorator def _const_dt(cachedir=None, num_cores=None, bse_options_json=None, # JSON string