Can you do a FILE() before attempting to copy the file?
lcTargetFile = "c:\test\target.dbf"
IF FILE(lcTargetFile)
&& Log that the file already exists
ELSE
TRY
COPY FILE (lcSourceFile) TO (lcTargetFile)
CATCH
&& Log problem of copying file.
ENDTRY
ENDIF
I've been using the COPYFILE from the WIN32API because it is faster than
the VFP based COPY FILE command. It might be worth looking into. I'm a
WebConnect customer so they have that in the wwAPI class.
HTH.
-Kevin
CULLY Technologies, LLC
Sponsor of FoxForward 2007
foxforward.net
Joe Yoder wrote:
> I need to copy a file from one directory to another. I use the COPY FILE
> <SourceFile> TO <DestinationName> inside the Try/Catch structure.
>
> When <SourceFile> does not exist, Catch gets control and all is well.
>
> When <DestinationName> does not exist, Catch gets control and all is well.
>
> When <DestinationName> already exists, I get an Interactive Message Box
> reporting that fact and asking what to do. Catch does not get control so
> there is a problem as this applications needs to run unattended!
>
> Does anyone know whether this behavior is by design and if so - why? Any
> workarounds?
>
> Thanks - Joe
>
>
>
> --- StripMime Report -- processed MIME parts ---
> multipart/alternative
> text/plain (text body -- kept)
> text/html
> ---
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://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.