Use ERR_BACKEND_READONLY if data file cannot be unlinked on write.

On Windows, we need write access to the data file to remove it before
replacing it by the already written out temp file.  We should not just
chmod the data file, but tell the user that it may be read-only.
ERR_FILEIO_BACKUP_ERROR was misleading because the backup actually
worked.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15873 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Andreas Köhler 2007-04-11 15:34:19 +00:00
parent 2bd54380ce
commit 584819956f

View File

@ -594,7 +594,7 @@ gnc_file_be_write_to_file(FileBackend *fbe,
}
if(g_unlink(datafile) != 0 && errno != ENOENT)
{
qof_backend_set_error(be, ERR_FILEIO_BACKUP_ERROR);
qof_backend_set_error(be, ERR_BACKEND_READONLY);
PWARN("unable to unlink filename %s: %s",
datafile ? datafile : "(null)",
strerror(errno) ? strerror(errno) : "");