projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
2008-01-15 Stephane Delcroix <sdelcroix@novell.com>
[mono.git]
/
mcs
/
class
/
corlib
/
System.IO
/
Directory.cs
diff --git
a/mcs/class/corlib/System.IO/Directory.cs
b/mcs/class/corlib/System.IO/Directory.cs
index a802b10c8c840df7c7cc68792e43cede60e0b0aa..dfc6049f1bc8f2bfcfce0e246f80464f95a30630 100644
(file)
--- a/
mcs/class/corlib/System.IO/Directory.cs
+++ b/
mcs/class/corlib/System.IO/Directory.cs
@@
-44,10
+44,14
@@
using System.Security.Permissions;
using System.Text;
#if NET_2_0
using System.Security.AccessControl;
using System.Text;
#if NET_2_0
using System.Security.AccessControl;
+using System.Runtime.InteropServices;
#endif
namespace System.IO
{
#endif
namespace System.IO
{
+#if NET_2_0
+ [ComVisible (true)]
+#endif
public
#if NET_2_0
static
public
#if NET_2_0
static
@@
-88,6
+92,14
@@
namespace System.IO
return CreateDirectoriesInternal (path);
}
return CreateDirectoriesInternal (path);
}
+#if NET_2_0
+ [MonoTODO ("DirectorySecurity not implemented")]
+ public static DirectoryInfo CreateDirectory (string path, DirectorySecurity directorySecurity)
+ {
+ return(CreateDirectory (path));
+ }
+#endif
+
static DirectoryInfo CreateDirectoriesInternal (string path)
{
if (SecurityManager.SecurityEnabled) {
static DirectoryInfo CreateDirectoriesInternal (string path)
{
if (SecurityManager.SecurityEnabled) {
@@
-143,8
+155,7
@@
namespace System.IO
*/
success = MonoIO.DeleteFile (path, out error);
} else {
*/
success = MonoIO.DeleteFile (path, out error);
} else {
- success = MonoIO.RemoveDirectory (path,
- out error);
+ success = MonoIO.RemoveDirectory (path, out error);
}
if (!success) {
}
if (!success) {
@@
-218,12
+229,12
@@
namespace System.IO
{
return File.GetLastAccessTime (path);
}
{
return File.GetLastAccessTime (path);
}
-
+
public static DateTime GetLastAccessTimeUtc (string path)
{
return GetLastAccessTime (path).ToUniversalTime ();
}
public static DateTime GetLastAccessTimeUtc (string path)
{
return GetLastAccessTime (path).ToUniversalTime ();
}
-
+
public static DateTime GetLastWriteTime (string path)
{
return File.GetLastWriteTime (path);
public static DateTime GetLastWriteTime (string path)
{
return File.GetLastWriteTime (path);
@@
-337,15
+348,15
@@
namespace System.IO
static bool IsRootDirectory (string path)
{
// Unix
static bool IsRootDirectory (string path)
{
// Unix
- if (Path.DirectorySeparatorChar == '/' && path == "/")
- return true;
+
if (Path.DirectorySeparatorChar == '/' && path == "/")
+
return true;
- // Windows
- if (Path.DirectorySeparatorChar == '\\')
- if (path.Length == 3 && path.EndsWith (":\\"))
- return true;
+
// Windows
+
if (Path.DirectorySeparatorChar == '\\')
+
if (path.Length == 3 && path.EndsWith (":\\"))
+
return true;
- return false;
+
return false;
}
public static DirectoryInfo GetParent (string path)
}
public static DirectoryInfo GetParent (string path)
@@
-368,34
+379,41
@@
namespace System.IO
return new DirectoryInfo (parent_name);
}
return new DirectoryInfo (parent_name);
}
- public static void Move (string s
rc, string dest
)
+ public static void Move (string s
ourceDirName, string destDirName
)
{
{
- if (s
rc
== null)
- throw new ArgumentNullException ("s
rc
");
+ if (s
ourceDirName
== null)
+ throw new ArgumentNullException ("s
ourceDirName
");
- if (dest == null)
- throw new ArgumentNullException ("dest");
+ if (dest
DirName
== null)
+ throw new ArgumentNullException ("dest
DirName
");
- if (s
rc.Trim () == "" || src
.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ("Invalid source directory name: " + s
rc, "src
");
+ if (s
ourceDirName.Trim () == "" || sourceDirName
.IndexOfAny (Path.InvalidPathChars) != -1)
+ throw new ArgumentException ("Invalid source directory name: " + s
ourceDirName, "sourceDirName
");
- if (dest
.Trim () == "" || dest
.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ("Invalid target directory name: " + dest
, "dest
");
+ if (dest
DirName.Trim () == "" || destDirName
.IndexOfAny (Path.InvalidPathChars) != -1)
+ throw new ArgumentException ("Invalid target directory name: " + dest
DirName, "destDirName
");
- if (s
rc == dest
)
- throw new IOException ("Source
directory cannot be same as a target directory
.");
+ if (s
ourceDirName == destDirName
)
+ throw new IOException ("Source
and destination path must be different
.");
- if (Exists (dest))
- throw new IOException (dest + " already exists.");
+ if (Exists (dest
DirName
))
+ throw new IOException (dest
DirName
+ " already exists.");
- if (!Exists (s
rc
))
- throw new DirectoryNotFoundException (s
rc
+ " does not exist");
+ if (!Exists (s
ourceDirName) && !File.Exists (sourceDirName
))
+ throw new DirectoryNotFoundException (s
ourceDirName
+ " does not exist");
MonoIOError error;
MonoIOError error;
- if (!MonoIO.MoveFile (s
rc, dest
, out error))
+ if (!MonoIO.MoveFile (s
ourceDirName, destDirName
, out error))
throw MonoIO.GetException (error);
}
throw MonoIO.GetException (error);
}
+#if NET_2_0
+ public static void SetAccessControl (string path, DirectorySecurity directorySecurity)
+ {
+ throw new NotImplementedException ();
+ }
+#endif
+
public static void SetCreationTime (string path, DateTime creation_time)
{
File.SetCreationTime (path, creation_time);
public static void SetCreationTime (string path, DateTime creation_time)
{
File.SetCreationTime (path, creation_time);
@@
-526,4
+544,3
@@
namespace System.IO
#endif
}
}
#endif
}
}
-