1212 |
} |
} |
1213 |
#else // POSIX ... |
#else // POSIX ... |
1214 |
if (unlink(filename.c_str())) { |
if (unlink(filename.c_str())) { |
1215 |
throw RIFF::Exception("Could not replace original file with temporary file (unable to remove original file): " + String(strerror(errno))); |
throw RIFF::Exception("Could not replace original file with temporary file (unable to remove original file): " + gig::String(strerror(errno))); |
1216 |
} |
} |
1217 |
#endif |
#endif |
1218 |
if (rename(tmpname.c_str(), filename.c_str())) { |
if (rename(tmpname.c_str(), filename.c_str())) { |
1219 |
#if defined(WIN32) |
#if defined(WIN32) |
1220 |
throw RIFF::Exception("Could not replace original file with temporary file (unable to rename temp file)."); |
throw RIFF::Exception("Could not replace original file with temporary file (unable to rename temp file)."); |
1221 |
#else |
#else |
1222 |
throw RIFF::Exception("Could not replace original file with temporary file (unable to rename temp file): " + String(strerror(errno))); |
throw RIFF::Exception("Could not replace original file with temporary file (unable to rename temp file): " + gig::String(strerror(errno))); |
1223 |
#endif |
#endif |
1224 |
} |
} |
1225 |
} |
} |