projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Pass cancellation token to CopyAsync read block
[mono.git]
/
mcs
/
class
/
corlib
/
System.IO
/
FileSystemInfo.cs
diff --git
a/mcs/class/corlib/System.IO/FileSystemInfo.cs
b/mcs/class/corlib/System.IO/FileSystemInfo.cs
index b8c1909ff24b5b0e89eddcb9299478fd544bcf19..9c2c3fae9f05eb3f21e12028c6c38e6d343370f9 100644
(file)
--- a/
mcs/class/corlib/System.IO/FileSystemInfo.cs
+++ b/
mcs/class/corlib/System.IO/FileSystemInfo.cs
@@
-3,6
+3,7
@@
// System.IO.FileSystemInfo.cs
//
// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
// System.IO.FileSystemInfo.cs
//
// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
+// Copyright 2011 Xamarin Inc (http://www.xamarin.com).
//
// Author: Jim Richardson, develop@wtfo-guru.com
// Dan Lewis (dihlewis@yahoo.co.uk)
//
// Author: Jim Richardson, develop@wtfo-guru.com
// Dan Lewis (dihlewis@yahoo.co.uk)
@@
-35,16
+36,19
@@
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
+using System.Security;
using System.Security.Permissions;
namespace System.IO {
[Serializable]
[FileIOPermission (SecurityAction.InheritanceDemand, Unrestricted = true)]
using System.Security.Permissions;
namespace System.IO {
[Serializable]
[FileIOPermission (SecurityAction.InheritanceDemand, Unrestricted = true)]
-#if NET_2_0
[ComVisible (true)]
[ComVisible (true)]
-#endif
+#if NET_2_1
+ public abstract class FileSystemInfo {
+#else
public abstract class FileSystemInfo : MarshalByRefObject, ISerializable {
public abstract class FileSystemInfo : MarshalByRefObject, ISerializable {
+
#region Implementation of ISerializable
[ComVisible(false)]
#region Implementation of ISerializable
[ComVisible(false)]
@@
-55,7
+59,7
@@
namespace System.IO {
}
#endregion Implementation of ISerializable
}
#endregion Implementation of ISerializable
-
+#endif
// public properties
public abstract bool Exists { get; }
// public properties
public abstract bool Exists { get; }
@@
-99,6
+103,8
@@
namespace System.IO {
}
set {
}
set {
+ SecurityManager.EnsureElevatedPermissions (); // this is a no-op outside moonlight
+
long filetime = value.ToFileTime ();
MonoIOError error;
long filetime = value.ToFileTime ();
MonoIOError error;
@@
-129,6
+135,8
@@
namespace System.IO {
}
set {
}
set {
+ SecurityManager.EnsureElevatedPermissions (); // this is a no-op outside moonlight
+
long filetime = value.ToFileTime ();
MonoIOError error;
long filetime = value.ToFileTime ();
MonoIOError error;
@@
-161,6
+169,8
@@
namespace System.IO {
}
set {
}
set {
+ SecurityManager.EnsureElevatedPermissions (); // this is a no-op outside moonlight
+
long filetime = value.ToFileTime ();
MonoIOError error;
long filetime = value.ToFileTime ();
MonoIOError error;
@@
-243,12
+253,15
@@
namespace System.IO {
{
if (path == null)
throw new ArgumentNullException ("path");
{
if (path == null)
throw new ArgumentNullException ("path");
-
if (path.Length == 0)
if (path.Length == 0)
- throw new ArgumentException ("path", Locale.GetText ("Empty path."));
-
+ throw new ArgumentException ("An empty file name is not valid.");
if (path.IndexOfAny (Path.InvalidPathChars) != -1)
if (path.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ("path", Locale.GetText ("Invalid characters in path."));
+ throw new ArgumentException ("Illegal characters in path.");
+ if (Environment.IsRunningOnWindows) {
+ int idx = path.IndexOf (':');
+ if (idx >= 0 && idx != 1)
+ throw new ArgumentException ("path");
+ }
}
internal MonoIOStat stat;
}
internal MonoIOStat stat;