FindFirstFile/FindNextFile dwFileAttributes unexpected value (or not)?

194 Views Asked by At

When I run my code, the file attribute is 32 for all of my files.

According to this Microsoft docs page:

FILE_ATTRIBUTE_ARCHIVE, 32 (0x20), A file or directory that is an archive file or directory. Applications typically use this attribute to mark files for backup or removal .

But those are normal .jpg files. I would have expected something like this:

FILE_ATTRIBUTE_NORMAL, 128 (0x80), A file that does not have other attributes set. This attribute is valid only when used alone.

Is this just my setup, or is this the expected value for normal files?

1

There are 1 best solutions below

0
phuclv On

There's nothing wrong with it. All files/folders in Windows have 4 basic attributes: Read-only, System, Hidden, Archive. The Archive attribute is pretty much useless these days because it's only used for backup tools to recognize whether a file has been backed up or not in the CP/M and DOS era and has nothing to do with the file type. Any files can have it enabled

It's also explained in the MSDN doc you linked above:

A file or directory that is an archive file or directory. Applications typically use this attribute to mark files for backup or removal .