[DUG] Delete (File) Function ?

Colin/Mina colmin at ihug.co.nz
Sun Jun 29 17:51:30 NZST 2008


Hi and thanks,

  Yes the ' \' is included.

   Since posting I've since come to the same conclusion by trying to delete it externally but I was told it was in use,  but can't seem to close it anyway. 

  I don't need it anymore so how can I simply destroy it regardless before creating a new one to take its place..

  Cheers
 
     Colin


  ----- Original Message ----- 
  From: John at padasy 
  To: 'NZ Borland Developers Group - Delphi List' 
  Sent: Sunday, June 29, 2008 4:54 PM
  Subject: Re: [DUG] Delete (File) Function ?


  Are you sure the file is not in use?

   

  John

   

  From: delphi-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz] On Behalf Of Colin/Mina
  Sent: Sunday, 29 June 2008 3:40 p.m.
  To: DUG, - Delphi
  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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20080629/67664c3b/attachment-0001.html 


More information about the Delphi mailing list