diff --git a/cpp/include/cudf_test/file_utilities.hpp b/cpp/include/cudf_test/file_utilities.hpp index 6c21d8dfad2..4df7b6a69c8 100644 --- a/cpp/include/cudf_test/file_utilities.hpp +++ b/cpp/include/cudf_test/file_utilities.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, NVIDIA CORPORATION. + * Copyright (c) 2020-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,6 +47,11 @@ class temp_directory { return std::remove(pathname); } + temp_directory& operator=(temp_directory const&) = delete; + temp_directory(temp_directory const&) = delete; + temp_directory& operator=(temp_directory&&) = default; + temp_directory(temp_directory&&) = default; + ~temp_directory() { // TODO: should use std::filesystem instead, once C++17 support added diff --git a/cpp/src/io/utilities/file_io_utilities.cpp b/cpp/src/io/utilities/file_io_utilities.cpp index e2893a2e881..f7e250f1d3f 100644 --- a/cpp/src/io/utilities/file_io_utilities.cpp +++ b/cpp/src/io/utilities/file_io_utilities.cpp @@ -88,13 +88,13 @@ class cufile_shim { void cufile_shim::modify_cufile_json() const { std::string const json_path_env_var = "CUFILE_ENV_PATH_JSON"; - temp_directory tmp_config_dir{"cudf_cufile_config"}; + static temp_directory tmp_config_dir{"cudf_cufile_config"}; // Modify the config file based on the policy auto const config_file_path = getenv_or(json_path_env_var, "/etc/cufile.json"); std::ifstream user_config_file(config_file_path); // Modified config file is stored in a temporary directory - auto const cudf_config_path = tmp_config_dir.path() + "/cufile.json"; + auto const cudf_config_path = tmp_config_dir.path() + "cufile.json"; std::ofstream cudf_config_file(cudf_config_path); std::string line;