file.waitFor(): Use fcntl
file.waitFor(): Use fcntl

Since os.O_EXLOCK is BSD-specific, instead use fcntl.lockf() to attempt to gain an exclusive lock on the file being waited on. This test is over and above obtaining write privileges to the file, which may fail if another process is still writing to that file.

MRtrix3/mrtrix3,MRtrix3/mrtrix3,MRtrix3/mrtrix3,MRtrix3/mrtrix3,MRtrix3/mrtrix3,MRtrix3/mrtrix3