2002-05-07 Mike Gray <mikeg_us@hotmail.com>
authorMiguel de Icaza <miguel@gnome.org>
Tue, 7 May 2002 01:39:48 +0000 (01:39 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Tue, 7 May 2002 01:39:48 +0000 (01:39 -0000)
* File.cs: Implemented CreateText method, and fixed dst compares
to compare against "" instead of null twice.

svn path=/trunk/mcs/; revision=4355

mcs/class/corlib/System.IO/ChangeLog
mcs/class/corlib/System.IO/File.cs

index 6eef1914c94b9238f7458f4e685a7e7d052743c9..865c488fec7cb22129f908227b9906e8cdc25f9b 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-07  Mike Gray     <mikeg_us@hotmail.com>
+
+       * File.cs: Implemented CreateText method, and fixed dst compares
+       to compare against "" instead of null twice.
+
 2002-05-05  Nick Drochak  <ndrochak@gol.com>
 
        * StreamReader.cs: Throw exceptions where needed. Changed Null field to
index 7632041cc57c70adca03f64e4ee4779af37472b1..9cdb58390a8ac91a3469bed243260d00f6107aaa 100644 (file)
@@ -36,7 +36,7 @@ namespace System.IO
                {       \r
                        if (src == null || dest == null)\r
                                throw new ArgumentNullException ();\r
-                       if (src == "" || dest == null ||\r
+                       if (src == "" || dest == "" ||\r
                            src.IndexOfAny (Path.InvalidPathChars) != -1 ||\r
                            dest.IndexOfAny (Path.InvalidPathChars) != -1)\r
                                throw new ArgumentException ();\r
@@ -55,7 +55,12 @@ namespace System.IO
                        return new FileStream (path, FileMode.Create, FileAccess.ReadWrite,\r
                                               FileShare.None, buffersize);\r
                }\r
-               \r
+
+               public static StreamWriter CreateText(string path)
+               {
+                       return new StreamWriter (path, false);
+               }
+               
                public static void Delete (string path)\r
                {\r
                        if (path == null)\r
@@ -105,7 +110,7 @@ namespace System.IO
                {\r
                        if (src == null || dest == null)\r
                                throw new ArgumentNullException ();\r
-                       if (src == "" || dest == null ||\r
+                       if (src == "" || dest == "" ||\r
                            src.IndexOfAny (Path.InvalidPathChars) != -1 ||\r
                            dest.IndexOfAny (Path.InvalidPathChars) != -1)\r
                                throw new ArgumentException ();\r