Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Move/Rename Directories in VFP
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00142543
Message ID:
00142613
Vues:
26
>I was reading some older threads on renaming directories, and discovered after some experimenting that you can rename them using VFP's rename command. I had no problem issuing the command below under Windows 95. Has anyone tested this on other operating systems?
>
rename "C:\Outlook 98 Setup." to "c:\the quickbrown fox."
>rename "c:\the quickbrown fox." to "C:\Outlook 98 Setup."
>
>I also noticed that rename will move a file across drives/directories if the file does not exist in the destination path. This is documented in help, but has eluded me until now. Since it may not be obvious to another developer, I think when I use this technique I'll use #DEFINE Move_File Rename so that the code would then read: Move_File FileName1 TO FileName2.
>
>You can also move directories on the same drive using this approach:
>
rename "C:\Outlook 98 Setup." to "c:\temp\the quickbrown fox."
>rename "c:\temp\the quickbrown fox." to "C:\Outlook 98 Setup."
>Note however, that you can not move a directory from one drive to another.

Hidy Ken,

I hate to be the bearer of bad news, but I haven't been able to replicate your examples. In VFP 5.0 and 6.0, I created some test sub-directories, but weren't able to rename them. I kept getting file does not exist in both 5.0 and 6.0. It might be better to stick with the Win API call MoveFile() to rename a directory until we can figure out why this works on one system and not another. BTW, I am using Win95 with a 32 bit file system.
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