Changeset 12418 for trunk/FACT++/src


Ignore:
Timestamp:
11/06/11 02:30:57 (13 years ago)
Author:
tbretz
Message:
Print a proper error message if rename() fails.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Fits.cc

    r12413 r12418  
    216216    }
    217217    if (rename(fFileName.c_str(), corruptName.str().c_str()) != 0)
    218         fMess->Error("Could not rename file " + fFileName);
    219     else
    220         fMess->Message("Renamed file " + fFileName + " to " + corruptName.str());
     218    {
     219        ostringstream str;
     220        str << "rename() failed for '" << fFileName << "': " << strerror(errno) << " [errno=" << errno << "]";
     221        fMess->Error(str);
     222        return;
     223    }
     224
     225    fMess->Message("Renamed file " + fFileName + " to " + corruptName.str());
    221226
    222227}
Note: See TracChangeset for help on using the changeset viewer.