From 00164176ef0d698a508156fd6bda3597e04bafe9 Mon Sep 17 00:00:00 2001 From: Iain Holmes Date: Tue, 4 Sep 2001 21:42:45 +0000 Subject: Check the file exists before trying to import it svn path=/trunk/; revision=12603 --- shell/e-shell-importer.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'shell/e-shell-importer.c') diff --git a/shell/e-shell-importer.c b/shell/e-shell-importer.c index ff0600ab98..e28a339191 100644 --- a/shell/e-shell-importer.c +++ b/shell/e-shell-importer.c @@ -25,6 +25,10 @@ #include #endif +#include +#include +#include + #include #include #include @@ -336,7 +340,18 @@ start_import (const char *folderpath, ImporterComponentData *icd; char *label; char *real_iid; + struct stat buf; + if (stat (filename, &buf) == -1) { + char *message; + + message = g_strdup_printf (_("File %s does not exist"), filename); + e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, message); + g_free (message); + + return; + } + if (iid == NULL || strcmp (iid, "Automatic") == 0) { /* Work out the component to use */ real_iid = get_iid_for_filetype (filename); -- cgit v1.2.3