[Mono-dev] [PATCH]ProcessModule.FileName mixing slashes on Windows.

Bill Holmes billholmes54 at gmail.com
Mon Aug 6 12:52:19 EDT 2007


This is a small bug that we can work around, but I have created a patch anyway.

The following sample mixes slashes on windows depending on how the
program was invoked.

mono slash/test.exe
d:\del\Monobugs\slash/test.exe

The attached patch replaces '/' with '\'
d:\del\Monobugs\slash\test.exe

Any other suggested fixes are welcome.  If a formal bug is needed, I
can create one.

using System;
using System.Diagnostics;

public class Program
{
	[STAThread]
	public static void Main (string[] args)
	{
		Process curproc = System.Diagnostics.Process.GetCurrentProcess ();
		ProcessModule Main = curproc.MainModule;
		string Main_FileName = Main.FileName;

		Console.WriteLine (Main_FileName);
	}
}

-bill
-------------- next part --------------
A non-text attachment was scrubbed...
Name: slash.diff
Type: application/octet-stream
Size: 1198 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070806/3dcdd87a/attachment.obj 


More information about the Mono-devel-list mailing list