Richard Kaye wrote on 2014-04-23: 
>  The FILE() function can have some unexpected behavior as it will also
search the VFP path. If for some reason you had the same file in a different
location it will still return .T. You may want to do something like obtain a
file handle to m.cFile before you try to delete it. And I would probably
wrap the whole thing in a TRY..CATCH.
>  
>  Untested Pseudo-code alert
>  
>  m.nHandle=FOPEN(m.cFile)
>  IF m.nHandle<>0
>       FCLOSE(m.nHandle)
>       ERASE (m.cFile)
>  ENDIF
>  
>  --
>  
>  rk

I've been using a different approach.
   Local FileList[1]
   If ADIR(FileList, m.cFile) = 0
      *-- File does not exist

Although the FOPEN ensures you can open the file for use. I have found some
Anti-Virus and some On-Demand backup systems will lock the file right after
I let it go. This causes the next attempt to use it to fail. YMMV


Tracy Pearson
PowerChurch Software


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to