Skip to content
Snippets Groups Projects
Select Git revision
  • d9b83dfada7e407c2b7c4b692dbcc22438d6edc0
  • trunk
  • RELEASE_6_5_DRIVEDB
  • RELEASE_6_6_DRIVEDB
  • RELEASE_7_0_DRIVEDB
  • RELEASE_7_2_DRIVEDB
  • RELEASE_7_3_DRIVEDB
  • RELEASE_6_0_DRIVEDB
  • RELEASE_6_1_DRIVEDB
  • RELEASE_6_2_DRIVEDB
  • RELEASE_6_3_DRIVEDB
  • RELEASE_6_4_DRIVEDB
  • tags/RELEASE_7_4
  • tags/RELEASE_7_3
  • RELEASE_5_41_DRIVEDB
  • RELEASE_5_42_DRIVEDB
  • RELEASE_5_43_DRIVEDB
  • tags/RELEASE_7_2
  • tags/RELEASE_7_1
  • tags/RELEASE_7_0
  • RELEASE_5_40_DRIVEDB
21 results

config

Blame
  • FT_delete_file.m 992 B
    %---------------------------------------------------------------------  
    % function []=FT_delete_file(filename)
    % 
    % deletes a file, USE CAREFULLY!
    %
    % filename: string, contains the name of the file
    %
    % Part of the SimTools package
    % Andreas Freise 16.06.08 afreise@googlemail.com
    %---------------------------------------------------------------------  
    
    function []=FT_delete_file(filename)
      
      baseid='FT_delete_file';
    
      if (~isstr(filename))
        msgid=[baseid,':checkinarg'];
        result='input argument must be a filename';
        error(msgid,result);
      end
      
      % check whether name contains / or \ so its
      % filename including the path
      
      ispath=0;
      if (strfind(filename,'\'))
        ispath=1;
      end
      
      if (strfind(filename,'/'))
        ispath=1;
      end
      
      if (ispath==0)
        filename=['./',filename];
      end
      
      if (exist(filename))
        disp(sprintf('deleting %s',filename));
        delete(filename);
      else
        disp(sprintf('cannot delete %s, file does not exist',filename));
      end