cprover
file_util.cpp File Reference
#include "file_util.h"
#include "exception_utils.h"
#include <cerrno>
#include <cstring>
+ Include dependency graph for file_util.cpp:

Go to the source code of this file.

Functions

std::string get_current_working_directory ()
 
void set_current_path (const std::string &path)
 Set working directory. More...
 
void delete_directory (const std::string &path)
 deletes all files in 'path' and then the directory itself More...
 
std::string concat_dir_file (const std::string &directory, const std::string &file_name)
 
bool is_directory (const std::string &path)
 
bool create_directory (const std::string &path)
 Create a directory with given path C++17 will allow us to use std::filesystem::create_directory. More...
 

Detailed Description

File Utilities

Definition in file file_util.cpp.

Function Documentation

◆ concat_dir_file()

std::string concat_dir_file ( const std::string &  directory,
const std::string &  file_name 
)
parameters: directory name and file name
Returns
concatenation of directory and file, if the file path is relative

Definition at line 159 of file file_util.cpp.

◆ create_directory()

bool create_directory ( const std::string &  path)

Create a directory with given path C++17 will allow us to use std::filesystem::create_directory.

Returns
true iff the directory was created

Definition at line 197 of file file_util.cpp.

◆ delete_directory()

void delete_directory ( const std::string &  path)

deletes all files in 'path' and then the directory itself

Definition at line 118 of file file_util.cpp.

◆ get_current_working_directory()

std::string get_current_working_directory ( )
Returns
current working directory

Definition at line 51 of file file_util.cpp.

◆ is_directory()

bool is_directory ( const std::string &  path)

Definition at line 172 of file file_util.cpp.

◆ set_current_path()

void set_current_path ( const std::string &  path)

Set working directory.

Parameters
pathNew working directory to change to

Definition at line 82 of file file_util.cpp.