FileShare.None, bufferSize);
}
-#if !NET_2_1
[MonoLimitation ("FileOptions are ignored")]
public static FileStream Create (string path, int bufferSize,
FileOptions options)
{
- return Create (path, bufferSize, options, null);
+ return new FileStream (path, FileMode.Create, FileAccess.ReadWrite,
+ FileShare.None, bufferSize, options);
}
+#if !NET_2_1
[MonoLimitation ("FileOptions and FileSecurity are ignored")]
public static FileStream Create (string path, int bufferSize,
FileOptions options,
#if !NET_2_1
public static FileSecurity GetAccessControl (string path)
{
- throw new NotImplementedException ();
+ // AccessControlSections.Audit requires special permissions.
+ return GetAccessControl (path,
+ AccessControlSections.Owner |
+ AccessControlSections.Group |
+ AccessControlSections.Access);
}
public static FileSecurity GetAccessControl (string path, AccessControlSections includeSections)
{
- throw new NotImplementedException ();
+ return new FileSecurity (path, includeSections);
}
#endif
public static void SetAccessControl (string path,
FileSecurity fileSecurity)
{
- throw new NotImplementedException ();
+ if (null == fileSecurity)
+ throw new ArgumentNullException ("fileSecurity");
+
+ fileSecurity.PersistModifications (path);
}
#endif
throw new NotSupportedException (Locale.GetText ("File encryption isn't supported on any file system."));
}
-#if MOONLIGHT || NET_4_0 || MOBILE
+#if NET_4_0
public static IEnumerable<string> ReadLines (string path)
{
return ReadLines (File.OpenText (path));