-1

I'm developing yet another software for copying data in various configurations. It is important to copy not only data but also all possible attributes available on filesystem. For Windows (most of versions) it works, but for Server 2025 Standard, version 24H2 and build 26100.7171 I observe strange behavior where a new directory has an additional file attribute of 268435456 = 0x1000000, but it is not described on the Microsoft page: https://learn.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants.

This bit persists as long as the directory is untouched. However, adding an entry within it or changing some permissions via right-click, Preferences, and changing Attributes, and then reverting that change causes the directory's file attributes to return to normal (16).

>>> os.mkdir("new")
>>> os.stat("new").st_file_attributes
268435472
>>> os.mkdir("new/not-empty")
>>> os.stat("new").st_file_attributes
16
>>> "%x" % 268435472
'10000010'

Why it is like that?

4
  • Found page: learn.microsoft.com/en-us/windows/win32/secauthz/… where that bit in section "Access Rights" is described as GENERIC_ALL 0x10000000 All possible access rights, BUT it still doesn't make sense Commented Nov 26 at 14:20
  • File attributes have nothing common with access rights. Generic_all here absolute unrelated. It is usual practic when windows use some undocumented flags, attributes, etc. Commented Nov 26 at 14:40
  • Thanks @RbMm for the reply, I wasn't aware that Microsoft does such things, probably I should ask there.... I don't know why downvoted :( it is programing problem with copying tools and failing test because of different file attributes. Commented Nov 26 at 18:44
  • BTW. if that question will be closed again then I had to face the true... stackoverflow is no longer useful, if AI can't answer question then it means you have to go to the software provider... Commented 2 days ago

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.