FACT++  1.0
void Fits::MoveFileToCorruptedFile ( )
private

Definition at line 349 of file Fits.cc.

References str.

350 {
351  ostringstream corruptName;
352  struct stat st;
353  int append = 0;
354  corruptName << fFileName << "corrupt" << append;
355  while (!stat(corruptName.str().c_str(), &st))
356  {
357  append++;
358  corruptName.str("");
359  corruptName << fFileName << "corrupt" << append;
360  }
361  if (rename(fFileName.c_str(), corruptName.str().c_str()) != 0)
362  {
363  ostringstream str;
364  str << "rename() failed for '" << fFileName << "': " << strerror(errno) << " [errno=" << errno << "]";
365  fMess->Error(str);
366  return;
367  }
368 
369  fMess->Message("Renamed file " + fFileName + " to " + corruptName.str());
370 
371 }
string fFileName
Definition: Fits.h:15
char str[80]
Definition: test_client.c:7
MessageImp * fMess
were to log the errors
Definition: Fits.h:42
int Error(const std::string &str)
Definition: MessageImp.h:49
int Message(const std::string &str)
Definition: MessageImp.h:46