OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
PathsAndFiles.hpp File Reference

Header file containing functions for creating files and folders. More...

#include <unistd.h>
#include <iostream>
#include <fstream>
#include <boost/filesystem.hpp>
#include "VCluster/VCluster.hpp"

Go to the source code of this file.

Functions

static std::string get_cwd ()
 Gets the current working directory and returns path as string.
 
static bool check_if_file_exists (std::string path)
 Checks if a file already exists.
 
static void create_file_if_not_exist (std::string path)
 Creates a file if not already existent.
 
static bool check_if_directory_exists (std::string path)
 Checks if a directory already exists.
 
static void create_directory_if_not_exist (std::string path, bool silent=0)
 Creates a directory if not already existent.
 

Detailed Description

Header file containing functions for creating files and folders.

Author
Justina Stark
Date
December 2019

Definition in file PathsAndFiles.hpp.

Function Documentation

◆ check_if_directory_exists()

static bool check_if_directory_exists ( std::string  path)
static

Checks if a directory already exists.

Parameters
pathStd::string with path of directory for which existence should be checked.
Returns
True, if directory exists, false if not.

Definition at line 85 of file PathsAndFiles.hpp.

◆ check_if_file_exists()

static bool check_if_file_exists ( std::string  path)
static

Checks if a file already exists.

Parameters
pathStd::string with path of file for which existence should be checked.
Returns
True, if file exists, false if not.

Definition at line 42 of file PathsAndFiles.hpp.

◆ create_directory_if_not_exist()

static void create_directory_if_not_exist ( std::string  path,
bool  silent = 0 
)
static

Creates a directory if not already existent.

Parameters
pathStd::string that contains path including name of the folder that should be created.

Definition at line 103 of file PathsAndFiles.hpp.

◆ create_file_if_not_exist()

static void create_file_if_not_exist ( std::string  path)
static

Creates a file if not already existent.

Parameters
pathStd::string that contains path including filename of the file that should be created.

Definition at line 66 of file PathsAndFiles.hpp.

◆ get_cwd()

static std::string get_cwd ( )
static

Gets the current working directory and returns path as string.

Returns
Std::string of path to current working directory.

Definition at line 24 of file PathsAndFiles.hpp.