Hi All,
I've been wrestling with this for a couple of day now, and it's really annoying me.
I'm trying to get and set the file properties, but i'm getting very inconsistent results..
I want to make sure the file is not readonly, hidden, system file etc.
According to Agraham the FilesEx needs the Bitwise.dll to be able to view the properties
I can understand that a file has a couple of bytes in which the properties are set, but i cant seem to get this info :-(
Can anyone point me in the right direction?
Below is a part of the code I used to test
I've also tried bit.GetBit(X,Y) and bit.GetBit(Y,X) (reverse the two)
also didn't do much ..
:sign0085:
Thanks!
I've been wrestling with this for a couple of day now, and it's really annoying me.
I'm trying to get and set the file properties, but i'm getting very inconsistent results..
I want to make sure the file is not readonly, hidden, system file etc.
According to Agraham the FilesEx needs the Bitwise.dll to be able to view the properties
I can understand that a file has a couple of bytes in which the properties are set, but i cant seem to get this info :-(
Can anyone point me in the right direction?
Below is a part of the code I used to test
B4X:
Sub read
bit.New1
Fex.New1
item1 = Fex.FileGetAttributes(FileLoc& "\test.txt")
listbox1.Clear
listbox1.Add("readonly - "&bit.GetBit(item1,1))
listbox1.Add("hidden - "&bit.GetBit(item1,2))
listbox1.Add("system - "&bit.GetBit(item1,4))
listbox1.Add("normal - "&bit.GetBit(item1,128))
End Sub
Sub write
bit.New1
Fex.New1
Fex.FileSetAttributes(FileLoc& "\test.txt",bit.SetBit(1,0))
Fex.FileSetAttributes(FileLoc& "\test.txt",bit.SetBit(2,0))
Fex.FileSetAttributes(FileLoc& "\test.txt",bit.SetBit(4,0))
Fex.FileSetAttributes(FileLoc& "\test.txt",bit.SetBit(128,0))
End Sub
I've also tried bit.GetBit(X,Y) and bit.GetBit(Y,X) (reverse the two)
also didn't do much ..
:sign0085:
Thanks!