diff --git a/src/adiar/adiar.cpp b/src/adiar/adiar.cpp index ee73a7946..908302382 100644 --- a/src/adiar/adiar.cpp +++ b/src/adiar/adiar.cpp @@ -70,6 +70,17 @@ namespace adiar } try { + // Set the temporary directory for TPIE before calling + // `tpie::tpie_init()`. This avoids a directory named `TPIE__<...>` + // at the default tmp path. + + // - file names + tpie::tempname::set_default_base_name("ADIAR"); + tpie::tempname::set_default_extension("adiar"); + + // - tmp directory + if (temp_dir != "") { tpie::tempname::set_default_path(temp_dir); } + // Initialise TPIE tpie::tpie_init(_tpie_subsystems); @@ -79,13 +90,6 @@ namespace adiar tpie::add_log_target(&_devnull); #endif - // - file names - tpie::tempname::set_default_base_name("ADIAR"); - tpie::tempname::set_default_extension("adiar"); - - // - tmp directory - if (temp_dir != "") { tpie::tempname::set_default_path(temp_dir); } - // - memory limit and block size tpie::get_memory_manager().set_limit(memory_limit_bytes); internal::set_block_size(internal::recommended_block_size(memory_limit_bytes));