diff --git a/libopenage/util/file.cpp b/libopenage/util/file.cpp index 3d0d4032ac..4a010c119a 100644 --- a/libopenage/util/file.cpp +++ b/libopenage/util/file.cpp @@ -14,9 +14,9 @@ #include "util/filelike/native.h" #include "util/filelike/python.h" +#include "util/fslike/directory.h" #include "util/path.h" #include "util/strings.h" -#include "util/fslike/directory.h" namespace openage::util { @@ -122,13 +122,12 @@ std::ostream &operator<<(std::ostream &stream, const File &file) { return stream; } -static File get_temp_file() { +File File::get_temp_file() { fslike::Directory temp_dir = fslike::Directory::get_temp_directory(); std::string file_name = std::tmpnam(nullptr); std::ostringstream dir_path; temp_dir.repr(dir_path); - mode_t mode = 0777; - File file_wrapper = File(dir_path.str() + file_name, mode); + File file_wrapper = File(dir_path.str() + file_name, 0777); return file_wrapper; } diff --git a/libopenage/util/fslike/directory.cpp b/libopenage/util/fslike/directory.cpp index 5695b3fc13..4143e376e3 100644 --- a/libopenage/util/fslike/directory.cpp +++ b/libopenage/util/fslike/directory.cpp @@ -11,8 +11,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -293,7 +293,7 @@ std::ostream &Directory::repr(std::ostream &stream) { return stream; } -static Directory get_temp_directory() { +Directory Directory::get_temp_directory() { std::string temp_dir_path = std::filesystem::temp_directory_path() / std::tmpnam(nullptr); bool create = true; Directory directory = Directory(temp_dir_path, create);