Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy file
Message
De
06/04/2001 12:20:50
 
 
À
06/04/2001 11:44:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00492830
Message ID:
00492885
Vues:
15
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform