How can I create a file in a directory protected with a read-only access rule?

Use the CreateFileDirect method; including the FILE_FLAG_BACKUP_SEMANTICS, FILE_ATTRIBUTE_DIRECTORY, and FILE_FLAG_POSIX_SEMANTICS attributes in the FlagsAndAttributes method parameter, and setting the CreationDisposition method parameter to FILE_CREATE.

We appreciate your feedback. If you have any questions, comments, or suggestions about this article please contact our support team at