]> git.tdb.fi Git - libs/datafile.git/commitdiff
Use FS::get_temp_dir to get the temporary directory
authorMikko Rasa <tdb@tdb.fi>
Sat, 16 Sep 2023 09:48:09 +0000 (12:48 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 16 Sep 2023 09:48:09 +0000 (12:48 +0300)
tool/packer.cpp

index 0380ee9ccf4661fc6825c23b15dd04414d7578a5..ae88ada2313f3aa5228d3eeb1b450d4203e57f0a 100644 (file)
@@ -1,8 +1,8 @@
-#include <msp/core/environ.h>
 #include <msp/datafile/parser.h>
 #include <msp/datafile/rawdata.h>
 #include <msp/datafile/statement.h>
 #include <msp/datafile/writer.h>
+#include <msp/fs/dir.h>
 #include <msp/fs/utils.h>
 #include <msp/io/memory.h>
 #include <msp/strings/format.h>
@@ -19,12 +19,7 @@ Packer::Packer(DataTool &t):
 
 IO::BufferedFile *Packer::tempfile()
 {
-       FS::Path tmpdir;
-       string tmp_env = Msp::getenv("TMPDIR");
-       if(!tmp_env.empty())
-               tmpdir = tmp_env;
-       else
-               tmpdir = "/tmp";
+       FS::Path tmpdir = FS::get_temp_dir();
 
        for(unsigned i=0;; ++i)
        {