Skip to content

Conversation

@Lestropie
Copy link
Member

Following on from discussion in #920.

I thought that perhaps there was some sort of network file system race condition that was causing the annoying standard_space_roi missing file issue in 5ttgen fsl (hence function file.waitFor()). It now appears as though it's sh not finding the script, yet giving a 0 return code. Differences in subprocess between Python versions may have contributed to the prior confusion in diagnosing - on top of the sh error message not being found until the -debug option was used.

Independently of the standard_space_roi issue, this function can also be used to wait for the run_first_all output rather than globally disabling SGE.

Need to confirm that this still works on Windows.

The intent of this function is to get a script to halt processing until a particular file not only exists, but a valid file handle can be acquired.
This can therefore be used in cases where e.g. network-based file systems may introduce a race condition within a script, or SGE may by used to execute a particular function but script execution immediately continues as soon as the jobs are sent.
Since this hopefully fixes issues encountered in the 5ttgen fsl script due to the use of SGE by the FSL script run_first_all, SGE has now been re-enabled.
@Lestropie Lestropie merged commit e4c4f45 into tag_0.3.16 Feb 28, 2017
@Lestropie Lestropie deleted the script_file_waitfor_function branch February 28, 2017 03:18
@Lestropie
Copy link
Member Author

Merged because tag_0.3.16 had borked script functionality. Works on Windows, and fixes 5ttgen fsl on a config that otherwise wouldn't run it at all. But if any issues arise post them straight away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants