|
It would be possible to construct a set of security attributes to pass to CreateFile that accurately represents the mode. In the worst case, this would involve looking up user and all group names and creating an entry for each. Alternatively, we could call the _chmod (partial emulation) function after file creation, although this leaves us with an obvious race.
Practically speaking, however, these efforts would be largely meaningless on FAT, the most common file system, which only has a "readable" and "writeable" flag, applying to all users.