~ubuntu-branches/ubuntu/raring/scilab/raring-proposed

« back to all changes in this revision

Viewing changes to modules/fileio/macros/rmdir.sci

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2012-08-30 14:42:38 UTC
  • mfrom: (1.4.7)
  • Revision ID: package-import@ubuntu.com-20120830144238-c1y2og7dbm7m9nig
Tags: 5.4.0-beta-3-1~exp1
* New upstream release
* Update the scirenderer dep
* Get ride of libjhdf5-java dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
// rmdir remove a directory
11
11
function [status,msg]=rmdir(varargin)
12
 
  lhs=argn(1);   
 
12
  lhs=argn(1);
13
13
  rhs=argn(2);
14
 
  
 
14
 
15
15
  DirName = '';
16
16
  status = 0;
17
17
  msg = '';
18
18
  SubDirMode = %F;
19
 
  
 
19
 
20
20
  select rhs
21
21
    case 0
22
22
     error(msprintf(gettext("%s: Wrong number of input argument(s).\n"),'rmdir'));
36
36
  else
37
37
     error(msprintf(gettext("%s: Wrong number of input argument(s).\n"),'rmdir'));
38
38
  end
39
 
  
 
39
 
40
40
  if ~SubDirMode then
41
 
    if findfiles(DirName)<>[] then 
 
41
    if findfiles(DirName)<>[] then
42
42
      status = 0
43
 
      msg = 'Error : The directory is not empty.'
 
43
      msg = gettext("Error: The directory is not empty.")
44
44
    else
45
45
      [status,msg] = hidden_rmdir(DirName);
46
46
    end
47
47
  else
48
48
        [status,msg] = hidden_rmdir(DirName);
49
 
  end   
 
49
  end
50
50
endfunction
51
51
//------------------------------------------------------------------------
52
52
function [status,msg]=hidden_rmdir(DirName)
53
53
  status = 0;
54
54
  msg = '';
55
 
  
 
55
 
56
56
  if isdir(DirName) then
57
57
    bOK = removedir(DirName);
58
58
    if bOK then
59
59
      msg = '';
60
60
      status = 1;
61
61
    else
62
 
      msg = msprintf(gettext("%s: An error occurred: %s\n"),'rmdir', gettext('Undefined'));
 
62
      msg = msprintf(gettext("%s: An error occurred: %s\n"),'rmdir', gettext("Undefined"));
63
63
      status = 0;
64
64
    end
65
65
  else
66
 
    msg = msprintf(gettext("%s: An error occurred: %s\n"),'rmdir', gettext('The system cannot find the file specified.'));
 
66
    msg = msprintf(gettext("%s: An error occurred: %s\n"),'rmdir', gettext("The system cannot find the file specified."));
67
67
    status = 0;
68
68
  end
69
69