From: GSV Three Minds in a Can on
If I getattr("filename") on a directory, I get the result x10
(vbdirectory), as expected. If, however, I disable 'allow indexing
service to ... <blah>' on the disc which contains the folder, and call
getattr again, I now get the result
x2010.

What, pray, is the undocumented x2000 bit value doing in the integer
result, and what does it actually mean? It appears to be screwing up at
least one application i run, if I turn content indexing off (probably
lousy coding by someone, but still ...)

--
GSV Three Minds in a Can
SC recommends the use of Firefox; Get smart, or get assimilated.
From: Karl E. Peterson on
GSV Three Minds in a Can wrote:
> If I getattr("filename") on a directory, I get the result x10
> (vbdirectory), as expected. If, however, I disable 'allow indexing
> service to ... <blah>' on the disc which contains the folder, and call
> getattr again, I now get the result
> x2010.
>
> What, pray, is the undocumented x2000 bit value doing in the integer
> result, and what does it actually mean? It appears to be screwing up
> at least one application i run, if I turn content indexing off
> (probably lousy coding by someone, but still ...)

Ah, this illustrates precisely why I don't like using GetAttr/SetAttr to toggle
attribute bits, especially with folders. (If you try setting, say, the system
attribute on that by or'ing it with what GetAttr returns and passing to SetAttr -
boom!)

Anyway, back to your question:

#define FILE_ATTRIBUTE_READONLY 0x00000001
#define FILE_ATTRIBUTE_HIDDEN 0x00000002
#define FILE_ATTRIBUTE_SYSTEM 0x00000004
#define FILE_ATTRIBUTE_DIRECTORY 0x00000010
#define FILE_ATTRIBUTE_ARCHIVE 0x00000020
#define FILE_ATTRIBUTE_DEVICE 0x00000040
#define FILE_ATTRIBUTE_NORMAL 0x00000080
#define FILE_ATTRIBUTE_TEMPORARY 0x00000100
#define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200
#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400
#define FILE_ATTRIBUTE_COMPRESSED 0x00000800
#define FILE_ATTRIBUTE_OFFLINE 0x00001000
#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000
#define FILE_ATTRIBUTE_ENCRYPTED 0x00004000

And, &h2000 definitely falls within Integer range, as well. Recommend you switch
over to API based GetAttr/SetAttr methods. Or, at least SetAttr, as that's the one
that typically blows...

Private Declare Function SetFileAttributes Lib "kernel32" Alias
"SetFileAttributesA" (ByVal lpFileName As String, ByVal dwFileAttributes As Long) As
Long

Public Function SetAttr(ByVal PathName As String, ByVal Attributes As Long) As
Boolean
' Nothing fancy, just set new attribute and return
SetAttr = SetFileAttributes(PathName, Attributes)
End Function

Later... Karl
--
[Microsoft Basic: 1976-2001, RIP]


From: GSV Three Minds in a Can on
Thanks Karl. Another case of the documentation not keeping up with the
actual code base I guess.


Bitstring <#necWCgGFHA.2280(a)TK2MSFTNGP15.phx.gbl>, from the wonderful
person Karl E. Peterson <karl(a)mvps.org> said
>GSV Three Minds in a Can wrote:
>> If I getattr("filename") on a directory, I get the result x10
>> (vbdirectory), as expected. If, however, I disable 'allow indexing
>> service to ... <blah>' on the disc which contains the folder, and call
>> getattr again, I now get the result
>> x2010.
>>
>> What, pray, is the undocumented x2000 bit value doing in the integer
>> result, and what does it actually mean? It appears to be screwing up
>> at least one application i run, if I turn content indexing off
>> (probably lousy coding by someone, but still ...)
>
>Ah, this illustrates precisely why I don't like using GetAttr/SetAttr to toggle
>attribute bits, especially with folders. (If you try setting, say, the system
>attribute on that by or'ing it with what GetAttr returns and passing to
>SetAttr -
>boom!)
>
>Anyway, back to your question:
>
> #define FILE_ATTRIBUTE_READONLY 0x00000001
> #define FILE_ATTRIBUTE_HIDDEN 0x00000002
> #define FILE_ATTRIBUTE_SYSTEM 0x00000004
> #define FILE_ATTRIBUTE_DIRECTORY 0x00000010
> #define FILE_ATTRIBUTE_ARCHIVE 0x00000020
> #define FILE_ATTRIBUTE_DEVICE 0x00000040
> #define FILE_ATTRIBUTE_NORMAL 0x00000080
> #define FILE_ATTRIBUTE_TEMPORARY 0x00000100
> #define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200
> #define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400
> #define FILE_ATTRIBUTE_COMPRESSED 0x00000800
> #define FILE_ATTRIBUTE_OFFLINE 0x00001000
> #define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000
> #define FILE_ATTRIBUTE_ENCRYPTED 0x00004000
>
>And, &h2000 definitely falls within Integer range, as well. Recommend
>you switch
>over to API based GetAttr/SetAttr methods. Or, at least SetAttr, as
>that's the one
>that typically blows...
>
> Private Declare Function SetFileAttributes Lib "kernel32" Alias
>"SetFileAttributesA" (ByVal lpFileName As String, ByVal
>dwFileAttributes As Long) As
>Long
>
> Public Function SetAttr(ByVal PathName As String, ByVal Attributes
>As Long) As
>Boolean
> ' Nothing fancy, just set new attribute and return
> SetAttr = SetFileAttributes(PathName, Attributes)
> End Function
>
>Later... Karl

--
GSV Three Minds in a Can
SC recommends the use of Firefox; Get smart, or get assimilated.