admin管理员组

文章数量:1202352

Background

In LLVM-libc, I am trying to create a new and modern implementation of POSIX layers on top of Windows API. I kind of lost myself on whether there is a way to map POSIX mode onto Windows' Access Control Mechanism (to the best effort if 100% compatibility is not possible).

Please be aware that LLVM-libc does not consider backward-compatibility with pre-Win10 editions. Hence, one can use modern Win32 API if needed.

What I have explored

  1. UCRT does not support mode in mkdir. That parameter is removed from function prototype and it always uses nullptr for windows ACL in CreateDirectory.

  2. For open in UCRT, the mode is handled via SetFileAttributesA. Only READ_ONLY is handled.

I Hope to Know

  1. Is there any existing translation example?
  2. If not, is there a suitable way to utilize ACL/FileAttributes to achieve the goal?

本文标签: cHow to map POSIX mode in creatmkdir to windows ACLFileAttributeStack Overflow