Skip to content

Commit

Permalink
2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
Browse files Browse the repository at this point in the history
	* Directory.cs: readded mkdir -p behavior. Thanks to kiwnix for
	pointing it out.

svn path=/trunk/mcs/; revision=12296
  • Loading branch information
gonzalop committed Mar 7, 2003
1 parent ea21a88 commit e8646f8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions mcs/class/corlib/System.IO/ChangeLog
@@ -1,3 +1,8 @@
2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>

* Directory.cs: readded mkdir -p behavior. Thanks to kiwnix for
pointing it out.

2003-03-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>

* MemoryStream.cs: general fixes and reformatted. Passes all tests in
Expand Down
11 changes: 10 additions & 1 deletion mcs/class/corlib/System.IO/Directory.cs
Expand Up @@ -42,13 +42,22 @@ public static DirectoryInfo CreateDirectory (string path)
if (path == ":")
throw new NotSupportedException ("Only ':' In path");

return CreateDirectoriesInternal (path);
}

static DirectoryInfo CreateDirectoriesInternal (string path)
{
DirectoryInfo info = new DirectoryInfo (path);
if (info.Parent != null && !info.Parent.Exists)
info.Parent.Create ();

MonoIOError error;
if (!MonoIO.CreateDirectory (path, out error)) {
if (error != MonoIOError.ERROR_ALREADY_EXISTS)
throw MonoIO.GetException (error);
}

return new DirectoryInfo (path);
return info;
}

public static void Delete (string path)
Expand Down

0 comments on commit e8646f8

Please sign in to comment.