Question

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.

Was it helpful?

Solution

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");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top