[Mono-dev] Not sure if this is a bug

Paul paul at all-the-johnsons.co.uk
Tue Feb 2 15:24:58 EST 2010


Hi,

Using md-2.2 and mono-2.6.1 (fedora rawhide).

Under .NET 3.5, the following works fine. Under mono, it's returning
that the file can't be opened despite it pointing at the correct place

public void dotheread()
		{
			try 
			{
				string path_env = Path.GetDirectoryName(Application.ExecutablePath)
+ Path.DirectorySeparatorChar;
				Stream stream = File.Open(path_env + "elements.ele",
FileMode.Open);
				BinaryFormatter bf = new BinaryFormatter();
				var elementgo = (List<Elements>)bf.Deserialize(stream);
				stream.Close();
			}
			catch(System.IO.FileNotFoundException)
			{
				string m = "Unable to find the elements information file : using " +
Path.GetDirectoryName(Application.ExecutablePath) +
Path.DirectorySeparatorChar + "elements.ele";
				MessageBox.Show(m, "File not found", MessageBoxButtons.OK);
			}
		}

The error box returns

"Unable to find the elements information file : using /media/USB
DISK/molarity/bin/Debug/elements.ele"

The file is stored in /media/USB DISK/molarity/bin/Debug/elements.ele -
not sure if the problem is that there is a space between USB and DISK
which could cause an issue.

Any ideas?

TTFN

Paul

-- 
Sie können mich aufreizen und wirklich heiß machen!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20100202/9dc8ef90/attachment.bin 


More information about the Mono-devel-list mailing list