Skip to content
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

use env var TMPDIR if defined #28

Open
EricDeveaud opened this issue Jul 2, 2020 · 0 comments
Open

use env var TMPDIR if defined #28

EricDeveaud opened this issue Jul 2, 2020 · 0 comments

Comments

@EricDeveaud
Copy link

Hello,

I noticed that tcoffe use /var/tmp by default if TMP_4_TCOFFEE nor UNIQUE_DIR_4_TCOFFEE are defined

tmp_4_tcoffee=(char*)vcalloc (1000, sizeof (char));
      char *v=getenv("TMP_4_TCOFFEE");
      if (getenv ("UNIQUE_DIR_4_TCOFFEE"))
          {
                  printf("UNIQUE_DIR_4_TCOFFEE\n");
                  sprintf (tmp_4_tcoffee, "%s/", getenv("UNIQUE_DIR_4_TCOFFEE"));
          }
      if (v && strm (v, "TMP"))sprintf (tmp_4_tcoffee, "%s/", getenv("TMP"));
      else if (v && strm (v, "LOCAL"))sprintf (tmp_4_tcoffee, "%s/", getcwd(NULL,0));
      else if (v && strm (v, "."))sprintf (tmp_4_tcoffee, "%s/", getcwd(NULL,0));
      else if (v)sprintf (tmp_4_tcoffee, "%s", v);
      else if (isdir("/var/tmp"))sprintf (tmp_4_tcoffee, "/var/tmp/");
      else if (isdir(get_dir_4_tcoffee ()))sprintf (tmp_4_tcoffee, "%s", get_dir_4_tcoffee());
      else sprintf (tmp_4_tcoffee, "%s/", getcwd(NULL,0));

      //now that rough location is decided, create the subdir structure

you may want to check environement TMPDIR before setting default value for tmp_4_tcoffee
using `/var/tmp/ may cause problems on some cluster compute nodes

regards

Eric

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant