Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RD blows up on non-empty folders
Message
De
17/09/2012 15:52:17
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01553085
Message ID:
01553087
Vues:
77
With this little function you can easily change the attributes of your files, to not hidden in this case. A simple loop with adir() and this function will make every file visible.
FUNCTION SetAttr
PARAMETER tFileName, tAttribute
tAttribute = UPPER(tAttribute)
Private nAttribute
nAttribute=0
If 'S'$tAttribute && System
   nAttribute = nAttribute + 4
Endif    
If 'H'$tAttribute && Hidden
   nAttribute = nAttribute + 2
Endif    
If 'R'$tAttribute && ReadOnly
   nAttribute = nAttribute + 1
Endif    
If 'A'$tAttribute && Archive
   nAttribute = nAttribute + 32
Endif    
If 'N'$tAttribute && Normal
   nAttribute = nAttribute + 128
Endif    
declare integer SetFileAttributes IN kernel32 STRING, INTEGER 
Return SetFileAttributes(tFileName,nAttribute)=1
>Hi Gang!
>
>If a folder is not empty, but has hidden files in it, what is the easiest way to REMOVE THIS FOLDER with VFP commands?? (If you try the following command, it throws an ERROR, since the folder is not empty).
>
>RD C:\PHARMACY\DOWNLOAD\DISK1\ and it has hidden files in it ??
>
>Thanks!
>
>PS.... if you use something other than VFP, can I be assured it will work with Windows 7 and 8 ??
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform