summaryrefslogtreecommitdiffstats
path: root/scilab/modules
diff options
context:
space:
mode:
authorAllan CORNET <allan.cornet@scilab.org>2010-05-12 16:31:58 +0200
committerClément DAVID <clement.david@scilab.org>2010-05-20 10:03:38 +0200
commitc2e0d3bc2b81438f4f5f18854ca6166877a65d82 (patch)
treef216c52121eff98020383fd416273a848d836390 /scilab/modules
parent1412f9c083f21d8d41d7ef7c9a27d7adceb46822 (diff)
downloadscilab-c2e0d3bc2b81438f4f5f18854ca6166877a65d82.zip
scilab-c2e0d3bc2b81438f4f5f18854ca6166877a65d82.tar.gz
more infos in error message
Change-Id: I5403262ca8b61a3d7977a820d3a926f6380874cc
Diffstat (limited to 'scilab/modules')
-rw-r--r--scilab/modules/io/src/c/v2cuniterror.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/scilab/modules/io/src/c/v2cuniterror.c b/scilab/modules/io/src/c/v2cuniterror.c
index 23ba1a0..080ed6b 100644
--- a/scilab/modules/io/src/c/v2cuniterror.c
+++ b/scilab/modules/io/src/c/v2cuniterror.c
@@ -13,6 +13,8 @@
13#include "localization.h" 13#include "localization.h"
14#include "v2cuniterror.h" 14#include "v2cuniterror.h"
15#include "Scierror.h" 15#include "Scierror.h"
16#include "FileExist.h"
17#include "isdir.h"
16/*--------------------------------------------------------------------------*/ 18/*--------------------------------------------------------------------------*/
17int C2F(v2cuniterror)(int *_errorcode, char *_filename, 19int C2F(v2cuniterror)(int *_errorcode, char *_filename,
18 unsigned long _length_filename) 20 unsigned long _length_filename)
@@ -27,16 +29,27 @@ int C2F(v2cuniterror)(int *_errorcode, char *_filename,
27 29
28 case 240: 30 case 240:
29 { 31 {
30 Scierror(*_errorcode, 32 if (FileExist(_filename))
31 _("File \"%s\" already exists or directory write access denied.\n"), 33 {
32 _filename); 34 Scierror(*_errorcode, _("File \"%s\" already exists.\n"), _filename);
35 }
36 else
37 {
38 Scierror(*_errorcode, _("\"%s\" directory write access denied.\n"), _filename);
39 }
33 } 40 }
34 break; 41 break;
35 42
36 case 241: 43 case 241:
37 { 44 {
38 Scierror(*_errorcode, 45 if (!FileExist(_filename))
39 _("File \"%s\" does not exist or read access denied.\n"), _filename); 46 {
47 Scierror(*_errorcode, _("File \"%s\" does not exist.\n"), _filename);
48 }
49 else
50 {
51 Scierror(*_errorcode, _("File \"%s\" read access denied.\n"), _filename);
52 }
40 } 53 }
41 break; 54 break;
42 55