From 4feddd7a495b346abd9913a7082aea36d4e09fa1 Mon Sep 17 00:00:00 2001 From: Lutz Mueller Date: Tue, 26 Feb 2002 10:08:22 +0000 Subject: [PATCH] =?UTF-8?q?2002-02-26=20=20Lutz=20M=EF=BF=BDller=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * directory.c (delete_file_func): In case of error, tell the user what went wrong. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@4224 67ed7778-7388-44ab-90cf-0a291f65f57c --- camlibs/directory/ChangeLog | 5 +++++ camlibs/directory/directory.c | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/camlibs/directory/ChangeLog b/camlibs/directory/ChangeLog index 29581fa4e..8f83d7d81 100644 --- a/camlibs/directory/ChangeLog +++ b/camlibs/directory/ChangeLog @@ -1,3 +1,8 @@ +2002-02-26 Lutz Müller + + * directory.c (delete_file_func): In case of error, tell the user + what went wrong. + 2002-02-13 Dan Fandrich * directory.c: Now using MIME type macros. Replaced // comment. diff --git a/camlibs/directory/directory.c b/camlibs/directory/directory.c index fcf161f03..05d4472a5 100644 --- a/camlibs/directory/directory.c +++ b/camlibs/directory/directory.c @@ -551,13 +551,19 @@ delete_file_func (CameraFilesystem *fs, const char *folder, const char *file, void *data, GPContext *context) { char path[2048]; + int result; if (strlen (folder) > 1) snprintf (path, sizeof (path), "%s/%s", folder, file); else snprintf (path, sizeof (path), "/%s", file); - if (unlink (path)) + result = unlink (path); + if (result) { + gp_context_error (context, _("Could not delete file '%s' " + "in folder '%s' (error code %i: %m)."), + file, folder, result); return (GP_ERROR); + } return (GP_OK); }