Xamarin Public Jenkins (auto-signing) c466f3c4f3 Imported Upstream version 6.0.0.207
Former-commit-id: 669b068a0086a928f56ccebfe966bf1d98acdb48
2019-05-01 08:33:05 +00:00

34 lines
1.0 KiB
C#

using System;
using System.Security.AccessControl;
namespace System.IO
{
public partial class File
{
public static FileStream Create (string path, int bufferSize, FileOptions options, System.Security.AccessControl.FileSecurity fileSecurity)
=> new FileStream(path, FileMode.Create, FileAccess.ReadWrite, FileShare.None, bufferSize, options); // ignore fileSecurity
public static FileSecurity GetAccessControl (string path)
{
// AccessControlSections.Audit requires special permissions.
return GetAccessControl (path,
AccessControlSections.Owner |
AccessControlSections.Group |
AccessControlSections.Access);
}
public static FileSecurity GetAccessControl (string path, AccessControlSections includeSections)
{
return new FileSecurity (path, includeSections);
}
public static void SetAccessControl (string path,
FileSecurity fileSecurity)
{
if (null == fileSecurity)
throw new ArgumentNullException ("fileSecurity");
fileSecurity.PersistModifications (path);
}
}
}