jeanbraun / Pecube

Thermo-kinematic model to invert thermochronological data
GNU General Public License v3.0
20 stars 20 forks source link

`tmp` directory needs to exist at run time #6

Closed davewhipp closed 5 years ago

davewhipp commented 5 years ago

It seems that Pecube cannot read the age data file without a directory called tmp in the base folder when a model is run. The file(s) created in tmp containing the names of the age data files cannot be created if the directory does not exist (at least based on my tests on macOS). The code continues execution, but gives an error about not being able to find the file with the list of age data files (see below). Creating the directory beforehand resolves the issue, but perhaps another option would be preferable (using system /tmp, for example).

Error message when running without tmp directory:

 ---------------------------------------------------------------------------------
 -------------------------------Pecube--------------------------------------------
 ---------------------------------------------------------------------------------
 version:4.2.0
 ---------------------------------------------------------------------------------
 -----------------------Echoing input parameters----------------------------------
 ---------------------------------------------------------------------------------
 echo_input_file - Value read is: 1
...
 ---------------------------------------------------------------------------------
 -----------------------------Reading data----------------------------------------
 ---------------------------------------------------------------------------------
sh: tmp/data_lst0000.txt: No such file or directory
 Reading data from folder: EXMP6/data/KGHelium
 Number of Age Samples:           0
...
jeanbraun commented 5 years ago

Thanks @davewhipp. I have fixed the issue. Now the directory is created at run time if it does not exists.