Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Wildcard Copies
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00088079
Message ID:
00088188
Vues:
24
>I'm trying to copy the contents of four directories
>from one machine to another programatically. The copies
>work fine in windows 95 using a dos bat file with the
>format: copy C:\Mydirectory\*.* S:\Mydirectory where S
>is a mapped drive. I would like to do this in VFP3 since
>I first update 4 files one each in the 4 directories I
>am copying and the update takes place in VFP3 and after
>the copy calls a VFP3 program which turns the originating
>machine off. The proble is that the DOS batch file
>proceeds to begin the copies without waiting for the
>VFP3 program to finish updating the files. I want to
>use a wildcard copy because the number of files is so
>large and I don't want to have to update this program
>if the system expands to include new files. Thanks
>Derek

Derek,
You still on this beast??? In addition to what Edward said, I found that ADIR() caused memory problems if the file list increased. What I do personally is to call DIR LIKE *.* TO , then use fopen(), and a do while ... loop to fgets the file list. This will pick up a list of files within the string (try dir like manually to see what comes out). Then you loop through each string picking out the file names (use trim and rat(' ') repeatedly to pull out the filenames). You can then do a COPY FILE for each file name you find. ADIR() with a 'D' clause will get any subdirectories. Be aware that you could get in a bit of a tangle if there are going to be many subdirectories - this is a nightmare (I've had some!!!). Regards,
Nigel B Coates
NBC Software Services
Dublin, Ireland.
eMail: Nigel.Coates@NBCSoftware.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform