[Mono-devel-list] Hangs on System.IO.MonoIO:Write
STEPHEN W. COREY - 5535
swc at wardandsmith.com
Mon Aug 1 10:22:03 EDT 2005
static void Main(string[] args)
{
if (args[0] == null)
{
Console.WriteLine("No filename specified!");
return;
}
ArrayList items = new ArrayList();
System.IO.StreamWriter file = new
System.IO.StreamWriter(args[0], false);
try
{
// Connect via LDAP
String LDAPPath = (LDAP PATH HERE);
DirectoryEntry lRoot = new DirectoryEntry(LDAPPath,
(USERNAME HERE), (PASSWORD HERE));
DirectorySearcher lSearcher = new
DirectorySearcher(lRoot);
SearchResultCollection lResults = null;
lSearcher.PropertiesToLoad.Add("mail");
lResults = lSearcher.FindAll();
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!
-----Original Message-----
From: mono-devel-list-bounces at lists.ximian.com
[mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf Of Paul F.
Johnson
Sent: Monday, August 01, 2005 10:17 AM
To: mono-devel
Subject: Re: [Mono-devel-list] Hangs on System.IO.MonoIO:Write
Hi,
> I've got a C# app (developed & tested on WinXP) which writes an
> ArrayList to a file, using a StreamWriter. The last line in the code
> is the call to StreamWriter.Close(). 75% of the time, the code runs
> flawlessly. Sporadically, though, it hangs on the call to
> System.IO.MonoIO:Write(). When I run mono with the "-v" parameter,
> here's what I get (I'm only showing the parts before/after the hang):
Any chance of a looksee at some code? Last time I had something like
this, I somehow managed to screw things up and overwrite part of the
stack!
TTFN
Paul
--
"Some people will do anything for a woman in uniform" - The Doctor -
Unregenerate (Big Finish audio)
_______________________________________________
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