[DUG] Delete (File) Function ?

Laurie.. lbisman at clear.net.nz
Sun Jun 29 15:48:25 NZST 2008


I assume you've added the '\' character between PathN and FileN.

Laurie..

  ----- Original Message ----- 
  From: Colin/Mina 
  To: DUG, - Delphi 
  Sent: Sunday, June 29, 2008 3:40 PM
  Subject: [DUG] Delete (File) Function ?


  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


------------------------------------------------------------------------------


  _______________________________________________
  NZ Borland Developers Group - Delphi mailing list
  Post: delphi at delphi.org.nz
  Admin: http://delphi.org.nz/mailman/listinfo/delphi
  Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject: unsubscribe


------------------------------------------------------------------------------



  No virus found in this incoming message.
  Checked by AVG. 
  Version: 8.0.101 / Virus Database: 270.4.2/1523 - Release Date: 6/28/2008 7:00 AM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20080629/5864e93c/attachment.html 


More information about the Delphi mailing list