550
564
struct stat encrypted_db_stat, plaintext_db_stat;
552
567
g_stat (self->priv->filename, &encrypted_db_stat);
570
g_set_error (error, ALMANAH_STORAGE_MANAGER_ERROR, ALMANAH_STORAGE_MANAGER_ERROR_CREATING_CONTEXT,
554
576
/* If we're decrypting, don't bother if the cipher file doesn't exist (i.e. the database hasn't yet been created), or is empty
556
578
if (g_file_test (self->priv->filename, G_FILE_TEST_IS_REGULAR) == TRUE && encrypted_db_stat.st_size > 0) {
559
579
/* Make a backup of the encrypted database file */
562
587
g_stat (self->priv->plain_filename, &plaintext_db_stat);