[Mono-dev] Not sure if this is a bug
John Feminella
johnf.pub at distb.net
Wed Feb 3 13:58:36 EST 2010
You may have to escape spaces in the path. Did you try escaping
all instances of " " with "\ " (that's a backslash, then a space)?
--
John Feminella
Principal Consultant, Distilled Brilliance
On Tue, Feb 2, 2010 at 15:24, Paul <paul at all-the-johnsons.co.uk> wrote:
> 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!
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
More information about the Mono-devel-list
mailing list