Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Anyway of Renaming Directory from VFP?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00068757
Message ID:
00069564
Vues:
41
>Hi all,
>
>Usually when I update my app to the customer site, I will put the newest tables structures to a temp directory and run my update program which will append all records from current directory to the temp. After doing this, I will copy from the temp and back to the exisiting current directory. When copying in progress, it takes time and to user it's like the system 'hang'. Is there any command to rename the directory instead? Or is there anyway I can display a thermometer if I use the COPY FILE command?
>
>Regards,
>Farouk Yew Abdullah

Farouk,

Yes, there is a way to re-name the directory (at least under VFP/Win 95 or NT).

Use the following API declaration:

DECLARE SHORT MoveFile IN Win32API;
STRING @lporgfile, STRING @lpnewfile

Rather than using file names simply use the directory name. For example, say the original directory was C:\VPF\TEMP and you wish to change it to C:\VFP\MYAPP, then:

lcolddir = "C:\VFP\TEMP"
lcnewdir = "C:\VFP\MYAPP"
= MoveFile(@lcolddir, @lcnewdir)

And the directory should be renamed. The only problem that could occur is if there is a file without an extension in the parent directory that has the same name as the child.

hth,

George
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform