[DUG] Delete (File) Function ?

Colin/Mina colmin at ihug.co.nz
Sun Jun 29 15:40:23 NZST 2008


Hi,

  I'm having a problem deleting a database file where PathN is a string containing the directory name eg: 'c:\Test' and FileN is a string containing the file name 
    eg:  'New Record.dbf''

  Using -
  
  if FileExists(PathN + File) then
  begin
      ShowMessage('File Exists');                                        // and it does
           if DeleteFile(PathN + 'New Record.dbf') then
              ShowMessage('File Deleted')                               // and it does occasionally
           else
              ShowMessage('File Not Deleted');                        // and it does mostly
  end;


  Note if I modify the code and use the 'Erase' procedure results are the same.


  Any clues as to why this oddity occurs? 

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20080629/29d96618/attachment.html 


More information about the Delphi mailing list