TF++, Miscellaneous classes and modules in C++:

◆ uniquenew()

std::string tfxx::file::uniquenew ( const char *  path)

return unique file name that does not already exist based on the path passed to the function.

Definition at line 113 of file filestatus.cc.

References exists().

Referenced by testfile().

114  {
115  std::string retval(path);
116  int i=0;
117  while (exists(retval.c_str()))
118  {
119  ++i;
120  std::ostringstream oss;
121  oss << path << "_" << i;
122  retval=oss.str();
123  }
124  return(retval);
125  } // std::string unique(const char* path)
bool exists(const char *path)
Definition: filestatus.cc:71
Here is the call graph for this function:
Here is the caller graph for this function: