Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
File Attributes, Modifying with VFP
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00703931
Message ID:
00703934
Vues:
21
>Is there a way to modify file attributes (maybe something similar to using the DOS ATTRIB command) within VFP code? Would appreciate any help. TIA

You can use WSH
oFSO = CREATEOBJECT("Scripting.FileSystemObject")
oFile = oFSO.GetFile(lcfile) && lcfile is the name of the file
* Turn on the read-only bit
oFile.Attributes = BITOR(oFile.Attributes, 0x01)
* Turn off the read-only bit
oFile.Attributes = BITAND(oFile.Attributes, 0xFE)
You can also use File Attribute Get & Set File #9311 or SetFileAttributes API #12727.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform