New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to temporary directory handling #1407

Merged
merged 3 commits into from Aug 8, 2018

Conversation

Projects
None yet
2 participants
@Lestropie
Member

Lestropie commented Jul 21, 2018

  • New environment variable MRTRIX_TMPFILE_DIR, which has precedence over the MRtrix config file in setting the location of the temporary directory used for piped images. If this is not set, environment variable TMPDIR will also be tested and used if set.

  • In Python scripts, use environment variable MRTRIX_TMPFILE_DIR to instruct any invoked MRtrix commands to place piped images within the temporary directory created by the Python library, rather than the default location.

Closes #1033.

Closes #1405.

Changes to temporary directory handling
- New environment variable MRTRIX_TMPFILE_DIR, which has precedence over the MRtrix config file in setting the location of the temporary directory used for piped images. If this is not set, environment variable TMPDIR will also be tested and used if set.
- In Python scripts, use environment variable MRTRIX_TMPFILE_DIR to instruct any invoked MRtrix commands to place piped images within the temporary directory created by the Python library, rather than the default location.
Closes #1033.
Closes #1405.

@Lestropie Lestropie self-assigned this Jul 21, 2018

@Lestropie Lestropie requested a review from jdtournier Jul 21, 2018

jdtournier added some commits Aug 3, 2018

@jdtournier

This comment has been minimized.

Member

jdtournier commented Aug 8, 2018

@Lestropie, see if you're happy with my latest commit...

@Lestropie

This comment has been minimized.

Member

Lestropie commented Aug 8, 2018

Yeah that's better.

const std::string __get_tmpfile_dir () {
const char* from_env_mrtrix = getenv ("MRTRIX_TMPFILE_DIR");
if (from_env_mrtrix) return from_env_mrtrix;
const char* from_env_general = getenv ("TMPDIR");

This comment has been minimized.

@jdtournier

jdtournier Aug 8, 2018

Member

Looks good, but I don't think the TMPDIR environment variable should be given precedence over the config file - it might set in different environments for other reasons than relevant here. I'd rather it was checked after the config file. Not 100% certain about this though... It'll depend largely on how these things are used in practice. It's not set on either my Win10 laptop or Arch Linux desktop, so not sure either way...

@jdtournier jdtournier merged commit a5a8bd6 into dev Aug 8, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jdtournier jdtournier deleted the mrtrix_tmpfile_dir_envvar branch Aug 8, 2018

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