Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy file
Message
From
06/04/2001 12:20:50
 
 
To
06/04/2001 11:44:12
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00492830
Message ID:
00492885
Views:
14
>Sorry , i didn't know how to paste the code correctly.
>Thank you very much, but we have the text file where we have the exact list of files that we want to copy, they are not necessery comming from the same directory and are not necessery all the files from a directory. That's why we were using (lctextFile = FILETOSTR(txtFileName) line). Sorry i didn't specify it in a first place. Do you have another sugestion?
>Thanks again.

The only thing I could think of was to optimize the code:
***
*
* BorderoPath(, )
*
* function copyeleList copies the files from 1 directory to another
*
* txtFileName
* the name of the text file
*
* newdir
* the path where to put the file
* Return:
*
*
*
FUNCTION copyeleList

PARAMETER tcFileName, tcNewdir, tlMacro
LOCAL lcTextFile, lnElements, lcFiletoCopy, lcFilePath, lnBCopy

lnBCopy = 0
lcTextFile = FILETOSTR(tcFileName)
lnElements = ALINES(aFileList, lcTextFile, .T.)
FOR i = 1 TO lnElements
     lcFiletoCopy = FULLPATH(ADDBS(aFileList[i]))
     lcNewdir = lcFiletoCopy + tcNewdir
     IF FILE(lcFiletoCopy)
*if file does exists
          COPY FILE (lcFiletoCopy) TO (newdir2)
          lnBCopy = lnBCopy + 1
     ELSE
*if file doesn't exists Use GetMess
          IF !tlMacro
          ENDIF
     ENDIF
ENDFOR
RETURN lnBCopy
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform