diff --git a/AK/TemporaryFile.cpp b/AK/TemporaryFile.cpp deleted file mode 100644 index 3ed991c01ff..00000000000 --- a/AK/TemporaryFile.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "TemporaryFile.h" -#include -#include -#include - -namespace AK { - -TemporaryFile::TemporaryFile() -{ - char nameBuffer[] = "/tmp/AKTemporaryFile.XXXXXX"; - int fd = mkstemp(nameBuffer); - if (fd != -1) { - m_stream = fdopen(fd, "w+"); - m_file_name = nameBuffer; - } -} - -TemporaryFile::~TemporaryFile() -{ - if (is_valid()) { - unlink(m_file_name.characters()); - fclose(m_stream); - } -} - -void TemporaryFile::sync() -{ - if (m_stream) - fflush(m_stream); -} - -} - diff --git a/AK/TemporaryFile.h b/AK/TemporaryFile.h deleted file mode 100644 index 624eeb4c9b2..00000000000 --- a/AK/TemporaryFile.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include "AKString.h" -#include - -namespace AK { - -class TemporaryFile { -public: - TemporaryFile(); - ~TemporaryFile(); - - bool is_valid() const { return m_stream; } - FILE* stream() { return m_stream; } - String file_name() const { return m_file_name; } - void sync(); - -private: - FILE* m_stream { nullptr }; - String m_file_name; -}; - -} - -using AK::TemporaryFile; -