How can I give write access to a file to all users? [modified]
-
I need to programatically give write-access to a file that is created by my program (which runs from an administrator account) to all users. How can I set the access-control lists for a file? I'm using CreateFile to create the file. [Edit] I'm talking about doing the equivalent of 'chmod a+w' to a file. How can I do that on Windows? I know NT has file permissions called ACL. Is this the way to do it?
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal
modified on Thursday, October 21, 2010 4:49 AM
-
I need to programatically give write-access to a file that is created by my program (which runs from an administrator account) to all users. How can I set the access-control lists for a file? I'm using CreateFile to create the file. [Edit] I'm talking about doing the equivalent of 'chmod a+w' to a file. How can I do that on Windows? I know NT has file permissions called ACL. Is this the way to do it?
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal
modified on Thursday, October 21, 2010 4:49 AM
One of the parameters of
CreateFile
is a security descriptor. Use this to control the access of the file. Here are some articles on how to use it - http://weblogs.asp.net/oldnewthing/archive/2004/03/12/88572.aspx[^] http://www.codeproject.com/KB/winsdk/accesscontrollists.aspx[^]«_Superman_»
I love work. It gives me something to do between weekends.