>
>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only