Skip to content

Commit

Permalink
init the static var normally
Browse files Browse the repository at this point in the history
  • Loading branch information
vuule committed Mar 9, 2022
1 parent 124479a commit 7b530ef
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cpp/src/io/utilities/file_io_utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,13 @@ class cufile_shim {
void cufile_shim::modify_cufile_json() const
{
std::string const json_path_env_var = "CUFILE_ENV_PATH_JSON";
static std::optional<temp_directory> tmp_config_dir;
if (not tmp_config_dir.has_value()) { tmp_config_dir = temp_directory{"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<std::string>(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;
Expand Down

0 comments on commit 7b530ef

Please sign in to comment.