Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP7: File copy overlay existing file

Status
Not open for further replies.

cj001

Programmer
Oct 3, 2001
145
US
Hello!

How do I force the overlaying of an existing file? Currently a message pops up asking if it is OK to overlay, but I want it to assume that it is OK to do so.


THANKS!
CJ


Below is my code:

SET PATH TO F:\I\Test\, F:\B\TestlnTotal = ADIR(laTemp,[F:\I\Test\*.pdf])

IF lnTotal > 0
THIS.Enabled = .F.
CREA CURSOR TEXTFILES (filename C(254))
APPE FROM ARRAY laTemp
SCAN
xfile2 = ("F:\B\TRND\")
xfile3 = ("F:\I\TRND\*.pdf")
RUN /N &xfile
COPY FILE ALLT(TEXTFILES.filename) TO (xfile2) ;
+ ALLT(TEXTFILES.filename)
ENDSCAN
DELETE FILE(xfile3)
THIS.Enabled = .T.
ENDIF
 
just a tip:
I usally globally set safety off but not always so when I need spacific set change I make a habit of grabbing current setting then change then put back like

OldSafetySetting=set('SAFETY')
set safety off
delete file myFile.txt
set safety (OldSafetySetting)

I do this in just about all cases where I change a SET inside code other then my Init setup for the Application lots of extra work but has saved my A** several times

Steve Bowman
steve.bowman@ultraex.com

 
Thank you stella740pl and Steve Bowman!

That worked perfectly.


:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top