Dear All,
how can i set multiple attrib for a file using FAttrib() method. For eg. Hidden and system together in a single Fattrib command
Sanil
FAttrib(FileName,02+04) // 02 -> Hidden and 04 -> System
anserkk wrote:
FAttrib(cFileName, ) ie without any parameter resets the attrib to empty
I don't know hot to reset a particular attrib alone ie to change READ ONLY attribute alone if the file already has a HIDDEN and READ ONLY attribute is set.
Antonio Linares wrote:You need to use nXor() to exclude the attributes that you don't want.
Or use nAnd() to select the attributes that you just want.
function Main()
local nAttrib := FAttrib( "test.prg" )
MsgInfo( nAttrib ) // 32 is shown
FAttrib( "test.prg", nOr( nAttrib, 4 ) ) // We want to set "system style"
MsgInfo( nAttrib := FAttrib( "test.prg" ) ) // 36 is shown
FAttrib( "test.prg", nXor( nAttrib, 4 ) ) // We want to remove "system style"
MsgInfo( FAttrib( "test.prg" ) ) // 32 is shown again
return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 87 guests