Are there methods in Mono C# to interact with file ACLs and extended ACLs?
I found the assembly Mono.Posix.dll, and the class UnixFileInfo.
This can give me nice things like the owner group and user, but no ACLs.
Does it exist? Or would I have to basically use DllImport for everything?
As far as I know,
Mono.Posixhas no implementation for ACLs.And also the namespace
System.Security.AccessControlis not implemented by Mono.If you want to change ACLs in Windows, you can create a library (dll) compiled with the .NET framework, using System.Security.AccessControl for do it, and then load it from Mono through reflection.
Here are some resources about how to use
System.Security.AccessControl:http://blog.crowe.co.nz/blog/archive/2007/08/25/c—An-example-of-setting-NTFS-Directory–File.aspx
Other alternative using
Microsoft.Win32.Security:http://weblogs.asp.net/cumpsd/archive/2004/02/08/69403.aspx
The other alternative is use
DllImportand call native methods.