Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Making a file Read-Only
Message
From
26/01/2000 10:43:41
 
 
To
26/01/2000 09:37:58
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00322772
Message ID:
00322826
Views:
16
>
>Anyone knows if it is possible to set a file's Read-Only attribute in VFP6 SP3?
>
If you have access to WSH:

#DEFINE FILE_ATTRIBUTE_READONLY 1
FUNCTION MakeReadOnly( lcFile)
IF NOT FILE( m.lcFile)
RETURN .F.
ENDIF
lcFile = FULLPATH( m.lcFile)
LOCAL loFso, loFile, lnAtt
loFso = CREATE( "Scripting.FileSystemObject" )
loFile = loFso.GetFile( m.lcFile)
lnAtt = loFile.Attributes
IF BITAND( m.lnAtt, FILE_ATTRIBUTE_READONLY) = 0
* not readonly yet
loFile.Attributes = BITOR( m.lnAtt, FILE_ATTRIBUTE_READONLY )
ENDIF
ENDFUNC

-- Randy
Previous
Reply
Map
View

Click here to load this message in the networking platform