[Mono-bugs] [Bug 50532][Min] Changed - Environment.SpecialFolders paths

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 23 Apr 2004 14:56:13 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by sebastien@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=50532

--- shadow/50532	2004-04-23 14:52:26.000000000 -0400
+++ shadow/50532.tmp.29501	2004-04-23 14:56:13.000000000 -0400
@@ -262,6 +262,35 @@
 (outside cygwin and for machine key pairs). 
 
 I propose to write an icall for the Windows version and use the
 current patch (with small adjustments) for other OS.
 
 That may not be perfect but it sure would be better than today.
+
+------- Additional Comments From sebastien@ximian.com  2004-04-23 14:56 -------
+Applied a modified version of the proposed patch.
+
+This fix the Windows problem (see 53260) as we now return the exact
+same value of MS.NET under Windows. It's also better than the current
+code.
+
+Notes:
+- There is no code to create an unexisting folder because this ISN'T
+the way Microsoft implements it in Windows;
+- Folder existance varies by Windows versions - so code must deal with
+the possible absence of a folder;
+- Users may delete the folder - code must also deal with this.
+
+e.g. Try running this
+
+Environment.SpecialFolder sf = Environment.SpecialFolder.Templates;
+string folder = Environment.GetFolderPath (sf);
+bool exists = Directory.Exists (folder);
+Console.WriteLine ("[{0}] - Folder {0} - {2}",
+	sf.ToString (), folder, 
+	((exists) ? "exists" : "do not exists"));
+
+
+Delete the template folder and, be warned, I don't know how to get it
+back ;-)
+Now re-run the sample. folder == String.Empty
+