Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Read only file
Message
 
To
13/07/2001 18:15:41
Spencer Redfield
Managed Healthcare Northwest, Inc.
Portland, Oregon, United States
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00529877
Message ID:
00530821
Views:
15
>Hi,
>
>I just ran across your 12/07/2001 Windows Script tip on how to turn on
>a file's read-only attribute and was able to successfully turn on a file's
>read-only property.
>
>My actual need is just the opposite. Might you be willing to suggest how
>I could turn off the read-only attribute?
>
>I know virtually nothing about Windows Scripting but found out that the
>normal file attribute constant is 0. Simply substituting the constant
>0 in place of 1 didn't work. Any help would be appreciated.
>
>Thank you in advance.
>

>
>(Your original tip)
> oFSO = CREATEOBJECT('Scripting.FileSystemObject')
> * Get an object reference to the file of interest
> oFile = oFSO.GetFile(lcfile)
> * Set to Read-Only
> oFile.Attributes = BITOR(oFile.Attributes, 1)

Sure. Instead of BITOR(), use BITXOR(). The all bit except bit zero will be retained.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform