I am trying to change file permissions in .NET Core. However, it seems that FileInfo no longer has SetAccessControl .
// Create a new FileInfo object. FileInfo fInfo = new FileInfo(FileName); // Get a FileSecurity object that represents the // current security settings. FileSecurity fSecurity = fInfo.GetAccessControl(); // Add the FileSystemAccessRule to the security settings. fSecurity.AddAccessRule(new FileSystemAccessRule(Account, Rights, ControlType)); // Set the new access settings. fInfo.SetAccessControl(fSecurity);
The goal is to simply add execution to the current owner of the file (which is not specific to Windows or Unix).
Any tips on how to do this on .NET Core?
c # file-permissions .net-core
Fab
source share