Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
amrex::FileSystem Namespace Reference

Functions

bool Exists (std::string const &filename)
 Check if the given path exists. Symbolic links are checked without following the link, so a dangling symbolic link is considered to exist.
 
std::string CurrentPath ()
 Return the current working directory.
 
bool Remove (std::string const &filename)
 Remove a file, symbolic link, or empty directory.
 
bool RemoveAll (std::string const &p)
 Recursively remove a path.
 
bool CreateDirectories (std::string const &path, mode_t mode, bool verbose=false)
 Create a directory and any missing parent directories.
 

Function Documentation

◆ CreateDirectories()

bool amrex::FileSystem::CreateDirectories ( std::string const &  path,
mode_t  mode,
bool  verbose = false 
)

Create a directory and any missing parent directories.

Parameters
pathdirectory path to create
moderequested permissions for newly-created directories on POSIX platforms; ignored on Windows
verboseprint a diagnostic message when directory creation fails
Returns
true if the directory already existed or was created without error, false if directory creation failed. This differs from the return value of std::filesystem::create_directories, which is true only when a directory was actually created and false both when the directory already existed and when creation failed with an error.

◆ CurrentPath()

std::string amrex::FileSystem::CurrentPath ( )

Return the current working directory.

Returns
current working directory path, or an empty string if it cannot be determined

◆ Exists()

bool amrex::FileSystem::Exists ( std::string const &  filename)

Check if the given path exists. Symbolic links are checked without following the link, so a dangling symbolic link is considered to exist.

Parameters
filenamepath to check
Returns
true if the path exists, false otherwise

◆ Remove()

bool amrex::FileSystem::Remove ( std::string const &  filename)

Remove a file, symbolic link, or empty directory.

Parameters
filenamepath to remove
Returns
true if a path was removed, false otherwise

◆ RemoveAll()

bool amrex::FileSystem::RemoveAll ( std::string const &  p)

Recursively remove a path.

Parameters
ppath to remove
Returns
true if removal completed without error, including when the path did not exist; false otherwise