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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moving files instead of Copying&Deleting 1

Status
Not open for further replies.

sqleptical

Programmer
Sep 26, 2001
112
US
Is there a way to move files from a .prg in 6.0 instead of copying and deleting? I need to do this on an on-going mass scale, and I think it will cut down on network traffic/collisions.
 
It is possible to move files, but only on the same logical drive. If you are transfering from one drive to another, copy and delete is the only way.



Regards

Griff
Keep [Smile]ing
 
Here is an example of how to do it:

Code:
** DECLARATION FOR MOVEFILE (WHICH WE HOPE WILL RENAME FOLDERS)
DECLARE INTEGER MoveFile IN Win32API STRING source, STRING destination
SET DEFAULT TO C:SET PATH TO C:MoveFile("c:\$incoming\1852.zip","c:\$incoming2\1852.zip")
The MoveFile will return 1 if successful or 0 for a fail



Regards

Griff
Keep [Smile]ing
 
Excellent. Do you happen to know the command? I couldn't find it in Microsoft's library, and MOVE does not work where COPY used to:

Move FILE(Loc1+filename) To (Loc2+filename)
Thanks for your help.
 
To answer your original question. Yes (in native VFP).

RENAME T:\MYDIR\MYFILE TO C:\OTHERDIR\MYFILE

Al

 
This might make your task even a little easier.

Supports wildcards and across drives (network):

RENAME T:\MYDIR\*.* TO C:\OTHERDIR\*.*

 
HI
Look into this thread

copyfile, copydir?
thread184-567231

Has plenty to note. Windows scripting will be very handy.
:)

ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
Thanks Griff & Al. Griff - The code you provided worked beautifully!

 
Thanks to Ramani as well. You are always so helpful!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top