diff --git a/m/ladcp/clear_prep.m b/m/ladcp/clear_prep.m
old mode 100755
new mode 100644
index fef3d00d3dec6b9d11bf94f686e7adafba74a7e3..be5ec575d177c2b23bc3d3922fdc7cb76207675a
--- a/m/ladcp/clear_prep.m
+++ b/m/ladcp/clear_prep.m
@@ -1,31 +1,49 @@
-function [] = clear_prep(stn,ndigits)
-% function [] = clear_prep(stn)
-%
-% clear the MAT files from prepare_cast
-%
-% input  :  stn     - station number
-%
-% version 0.1   last change 06.03.2006
-
-% G.Krahmann, IFM-GEOMAR, March 2006
-
-if nargin<2
-   ndigits = 3;
-end
-
-if ischar(stn)
-   stn_str = stn;
-else
-   stn_str = int2str0(stn,ndigits);
-end
-
-disp(' ')
-disp(['clear_prep : removing mat-files for station ',stn_str])
-
-delete(['data/ctdprof/ctdprof',stn_str,'.mat'])
-delete(['data/ctdtime/ctdtime',stn_str,'.mat'])
-delete(['data/nav/nav',stn_str,'.mat'])
-delete(['data/sadcp/sadcp',stn_str,'.mat'])
-delete(['data/sadcp/sadcp2',stn_str,'.mat'])
-delete(['data/dvl/dvl',stn_str,'.mat'])
-delete(['data/buc/buc',stn_str,'.mat'])
\ No newline at end of file
+function [] = clear_prep(stn,ndigits)
+% function [] = clear_prep(stn)
+%
+% clear the MAT files from prepare_cast
+%
+% input  :  stn     - station number
+%
+% version 0.1   last change 06.03.2006
+
+% G.Krahmann, IFM-GEOMAR, March 2006
+
+if nargin<2
+  ndigits = 3;
+end
+
+if ischar(stn)
+  stn_str = stn;
+else
+  stn_str = int2str0(stn,ndigits);
+end
+
+file_deleted = 0;
+
+disp(' ')
+disp(['clear_prep : removing mat-files for station ',stn_str])
+matfile = ['LADCP/data/ctdprof/ctdprof',stn_str,'.mat'];
+delete_file(matfile);
+matfile = ['LADCP/data/ctdtime/ctdtime',stn_str,'.mat'];
+delete_file(matfile);
+matfile = ['LADCP/data/nav/nav',stn_str,'.mat'];
+delete_file(matfile);
+matfile = ['LADCP/data/sadcp/sadcp',stn_str,'.mat'];
+delete_file(matfile);
+matfile = ['LADCP/data/sadcp/sadcp2',stn_str,'.mat'];
+delete_file(matfile);
+matfile = ['LADCP/data/dvl/dvl',stn_str,'.mat'];
+delete_file(matfile);
+matfile = ['LADCP/data/buc/buc',stn_str,'.mat'];
+delete_file(matfile);
+fprintf(1, '%d file(s) deleted\n', file_deleted);
+
+  function delete_file(matfile)
+    if isfile(matfile)
+      delete(matfile)
+      fprintf(1, 'delete file %s\n', matfile);
+      file_deleted = file_deleted + 1;
+    end
+  end
+end
\ No newline at end of file