#include "temporary_file.hpp"

#include <unistd.h>

#include <phosphor-logging/elog-errors.hpp>

#include <cerrno>
#include <cstdlib>
#include <stdexcept>
#include <string>

namespace openpower::util
{
using namespace phosphor::logging;

TemporaryFile::TemporaryFile()
{
    // Build template path required by mkstemp()
    std::string templatePath =
        fs::temp_directory_path() / "openpower-proc-control-XXXXXX";

    // Generate unique file name, create file, and open it.  The XXXXXX
    // characters are replaced by mkstemp() to make the file name unique.
    int fd = mkstemp(templatePath.data());
    if (fd == -1)
    {
        throw std::runtime_error{
            std::string{"Unable to create temporary file: "} + strerror(errno)};
    }

    // Store path to temporary file
    path = templatePath;

    // Close file descriptor
    if (close(fd) == -1)
    {
        // Save errno value; will likely change when we delete temporary file
        int savedErrno = errno;

        // Delete temporary file.  The destructor won't be called because
        // the exception below causes this constructor to exit without
        // completing.
        remove();

        throw std::runtime_error{
            std::string{"Unable to close temporary file: "} +
            strerror(savedErrno)};
    }
}

void TemporaryFile::remove()
{
    if (!path.empty())
    {
        // Delete temporary file from file system
        fs::remove(path);

        // Clear path to indicate file has been deleted
        path.clear();
    }
}

} // namespace openpower::util
