GNOME Bugzilla – Bug 330932
File open dialog message misleading for files with no read access.
Last modified: 2018-06-29 20:57:49 UTC
When opening a file that the user doesn't have read access to, the error dialog is a bit cryptic: The file type of file <FILENAME> is unknown. This may be misleading to the user. The message should indicate a permission problem. This was discussed in the following email thread: https://lists.gnucash.org/pipermail/gnucash-devel/2006-February/016348.html
Excerpts from the subsequent email discussion: AL> Aaron Larson NW> Neil Williams DA> Derek Atkins AL> ...When opening a file that the user doesn't have read access to, AL> the error is a bit cryptic: AL> The file type of file <FILENAME> is unknown. NW> I know how that happens - gnucash tries to identify the file by NW> letting each backend try to open it in turn. If none can open it, NW> it complains that it cannot understand which type of file it is NW> meant to be. We can't use mimetypes to distinguish the forms (as NW> two are text/xml and we've never enforced a mime-type on old NW> files) so we do have to open the file to determine the type. DA> Well, the other option is to actually pass the error up the stack DA> so that the caller can get a GNC_BACKEND_ERR_FILE_INACCESSIBLE (or DA> something like that) up the stack.. I've seen similar DA> error-hiding as a result of qof_session_export() not passing the DA> error up the stack. :( NW> But when trying to determine the type, all we know is if it is the NW> correct type or not. In QSF, I'm implementing : NW> f=fopen(path, "r"); NW> if(!f){ qof_backend_set_error(...);} NW> fclose(f); NW> block that sets a new QofBackendError: ERR_FILEIO_READ_ERROR at NW> the start of the file type check which I can also implement in NW> gnucash. So at least then, if we can't open the file for reading, NW> we can set a backend error and quit the load.
*** This bug has been marked as a duplicate of 351351 ***
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=330932. Please update any external references or bookmarks.