[Mono-list] File IO error

Dan Lewis dlewis@gmx.co.uk
04 May 2002 17:13:25 +0100


Thanks Nick. I'll have to look at this tomorrow, but from the looks of
things CreateFile() in io.c doesn't set the last error properly.

Dan.


On Sat, 2002-05-04 at 16:30, Nick Drochak wrote:
> RxDan,
> 
> I think you were the one working on the file IO bits, so I'll address
> this to you.  Anyone else who wants to fix it, please submit a patch to
> the list.
> 
> I worked on StreamReader bugs a bit, and found some errors in how file
> IO exceptions are thrown.  Here's a simple test case that shows a
> typical problem when the file cannot be found.  An incorrect exception
> is thrown: (btw, bugzilla is down right now so I'm sending to the list)
> 
> using System.IO;
> using System;
> 
> namespace NS {
> 	class C {
> 		public static int Main() {
> 			try {
> 				FileStream f = new
> FileStream("filenotthereforsure", FileMode.Open);
> 			} catch (FileNotFoundException) {
> 				return 0;
> 			}
> 			return 1;
> 		}
> 	}
> }
> 
> Run this on mono on Linux, and you'll see the problem.
> 
> Good night,
> Nick D.
> 
> 
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list@ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list