[Mono-devel-list] Hangs on System.IO.MonoIO:Write

STEPHEN W. COREY - 5535 swc at wardandsmith.com
Mon Aug 1 10:27:34 EDT 2005


I'm not reading any file, though. I make an LDAP call, and use a foreach
to iterate through the results. The only file IO I'm doing is writing. 

-----Original Message-----
From: mono-devel-list-bounces at lists.ximian.com
[mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf Of Paul
Sent: Monday, August 01, 2005 10:25 AM
To: mono-devel
Subject: RE: [Mono-devel-list] Hangs on System.IO.MonoIO:Write

Hi,

> 		foreach (SearchResult lResult in lResults)
> 		{
> 			if (lResult.Properties["mail"] != null)
> 				foreach (String item in
> lResult.Properties["mail"])
> 				{
> 					if
> (item.IndexOf("wardandsmith.com") > 0)
> 	
> //Console.WriteLine(item);
> 	
> file.WriteLine(item.ToLower());
> 				}
> 		}
> 	} 
> 	catch (Exception exc)
> 	{
> 		Console.WriteLine("ERRNUM: " + exc.Message);
> 		Console.WriteLine("ERRNUM: " + exc.InnerException);
> 		Console.WriteLine("ERRNUM: " + exc.Source);
> 		Console.WriteLine("ERRNUM: " + exc.StackTrace);		
> 	}			
> 	file.Close();
> }
> 
> 
> The very last line in the code is where the Close() call is. If you 
> can find anything wrong, I'd be very grateful!

By the looks of it, the problem is the read routine more than anything
as it looks like you may be reading past the end of the file which means
the close at the end generates an error.

TTFN

Paul
--
"Some people will do anything for a woman in uniform" - The Doctor -
Unregenerate (Big Finish audio)





More information about the Mono-devel-list mailing list