Rosetta  2020.46
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Namespaces | Functions
file_sys_util.hh File Reference

Platform independent operations on files (except I/O) More...

#include <utility/file/FileName.fwd.hh>
#include <ios>
#include <utility/vector1.fwd.hh>

Namespaces

 utility
 unresizable vector whose size is known at compile time, which may be allocated on the stack, and which indexes from 0.
 
 utility::file
 

Functions

bool utility::file::file_exists (std::string const &path)
 Does File Exist? More...
 
bool utility::file::is_directory (std::string const &path)
 Is the given path a directory? More...
 
int utility::file::file_delete (std::string const &path)
 Delete File. More...
 
std::string utility::file::file_extension (std::string const &filename)
 Extension of a File Name. More...
 
std::string utility::file::file_basename (std::string const &filename)
 Basename of a File Name. More...
 
long utility::file::file_size (std::string const &filename)
 Platform independent way of getting file size. More...
 
std::string utility::file::cwd ()
 current working directory More...
 
std::string utility::file::get_home_dir ()
 Get the (absolute) path to the users home directory. More...
 
bool utility::file::create_blank_file (std::string const &blank_file)
 Create a blank file if it doesn't already exist. More...
 
std::string utility::file::create_temp_filename (std::string const &dir, std::string const &prefix)
 Find an unused random tempfile name with a given prefix (which may include a directory) More...
 
bool utility::file::create_directory (std::string const &dir_path)
 Create a directory if it doesn't already exist. More...
 
bool utility::file::create_directory_recursive (std::string const &dir_path)
 Create a directory and its parent directories if they doesn't already exist. More...
 
bool utility::file::trytry_ifstream_open (std::ifstream &ifstream_, std::string const &name, std::ios_base::openmode open_mode)
 Try to open file a few times just in case it is locked (from BOINC LIB) More...
 
bool utility::file::trytry_ofstream_open (std::ofstream &ofstream_, std::string const &name, std::ios_base::openmode open_mode)
 Try to open file a few times just in case it is locked (from BOINC LIB) More...
 
int utility::file::list_dir (std::string dir, utility::vector1< std::string > &files)
 generate sorted file listing for given directory, return non-zero value on error More...
 
FileName utility::file::combine_names (utility::vector1< std::string > file_name_strings)
 
bool utility::file::change_working_directory (std::string const &dir_path)
 Changes the current working directory. More...
 

Detailed Description

Platform independent operations on files (except I/O)

Author
David Kim (dekim.nosp@m.@u.w.nosp@m.ashin.nosp@m.gton.nosp@m..edu)
Ion Yannopoulos (ion@r.nosp@m.oset.nosp@m.tacom.nosp@m.mons.nosp@m..org)