dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/IO Directory.cs, 1.17,


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/IO Directory.cs, 1.17, 1.18
Date: Wed, 06 Aug 2003 01:48:31 -0400

Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System/IO
In directory subversions:/tmp/cvs-serv28733/runtime/System/IO

Modified Files:
        Directory.cs 
Log Message:


Handle recursive directory creation.


Index: Directory.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/IO/Directory.cs,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** Directory.cs        24 Apr 2003 06:05:03 -0000      1.17
--- Directory.cs        6 Aug 2003 05:48:29 -0000       1.18
***************
*** 520,524 ****
                        {
                                ValidatePath(path);
!                               
HandleErrorsDir(DirMethods.CreateDirectory(path));
                                return new DirectoryInfo(path);
                        }
--- 520,547 ----
                        {
                                ValidatePath(path);
!                               Errno error = DirMethods.CreateDirectory(path);
!                               if(error != Errno.Success)
!                               {
!                                       // The path may already exist.
!                                       if(Exists(path))
!                                       {
!                                               return new DirectoryInfo(path);
!                                       }
! 
!                                       // Attempt to create the parent 
directory.
!                                       String parent = 
Path.GetDirectoryName(path);
!                                       if(parent == null)
!                                       {
!                                               HandleErrorsDir(error);
!                                       }
!                                       CreateDirectory(parent);
! 
!                                       // Now try creating the child directory 
again.
!                                       error = 
DirMethods.CreateDirectory(path);
!                                       if(error != Errno.Success)
!                                       {
!                                               HandleErrorsDir(error);
!                                       }
!                               }
                                return new DirectoryInfo(path);
                        }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]