I am using the the GetFileAttributes() function in my code. Its return the value as 0x2010. Because, Its saying, "FILE_ATTRIBUTE_NOT_CONTENT_INDEXED". I need output as 0x10. Please help me to resolve this. I am using empty folder to get file attributes.
Asked
Active
Viewed 652 times
1 Answers
0
The output is 0x10
. I.e., it's 0x2000
which means FILE_ATTRIBUTE_NOT_CONTENT_INDEXED and it's also 0x10
which means FILE_ATTRIBUTE_DIRECTORY. The values are bitwise-or'ed together. You can test them like this:
if (file_attr & 0x10)
puts("FILE_ATTRIBUTE_DIRECTORY");

ooga
- 15,423
- 2
- 20
- 21
-
That doesn't make any sense. If the file is not content-indexed then that flag will be set. Just reset it if you want (subtracting 0x2000 is perhaps the conceptually simplest way). – ooga Apr 11 '14 at 05:56
-
Then, How do I make that folder as content indexed. – Muthupandi Apr 11 '14 at 05:59
-
1That way madness lies. Why do you think you need to do that? – ooga Apr 11 '14 at 06:00
-
After getting the result as 0x2010 then change that value.I think, this not a correct solution for making the file to be content indexed. I want to make the file as content indexed. I don't know, what wrong in this. Is making the file or folder as content indexed is wrong thing?. In simple way, i am expecting, the file or folder shouldn't contain the attribute "FILE_ATTRIBUTE_NOT_CONTENT_INDEXED". – Muthupandi Apr 11 '14 at 13:48
-
@user3440628, Your original question implied nothing about your desire to content-index your files. I'm not sure how to get that done, but one possibility is to do a disk-wide search for a file that doesn't exist. That should reach every file and folder, and it might also content-index them for faster searching next time. – ooga Apr 11 '14 at 15:38