Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting File Attributes
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00049383
Message ID:
00049385
Vues:
57
>What is the best way to change a file attribute?
>I want to be able to make a file readable (if not already)
>I would rather not have to use the DOS attrib function, so I don't have to
>mess with the DOS window and pif's and so on.
>
>Here is what I tried:
>Declare Integer CreateFile in WIN32API STRING, INTEGER, INTEGER, INTEGER, INTEGER, INTEGER, INTEGER
>Declare Integer CloseHandle in WIN32API INTEGER
>fhHandle = CreateFile('FileName',0,0,0,3,32,0)
>=CloseHandle(fhHandle)
>
>where
>3 = OPEN_EXISTING
>32 = FILE_ATTRIBUTE_ARCHIVE
>I believe :-)
>
>I thought this would change the attrib, but when I did an ADIR() I see that
>the file is still read-only.
>
>Any wisdom would be greatly appreciated.

You have a FAQ on that here which explain the write and read for attributes. See the Knowledge Base FAQ section under WIN32API category.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform