🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.csharpbuilder.language.csharp
Article #668

Re: 'File in use' error after File.Create()

#668
From: Marc Rohloff TeamB
Date: Fri, 24 Sep 2004 00:43
32 lines
1423 bytes
On Wed, 22 Sep 2004 22:41:08 -0600, Joe Mayo wrote:


> or (which essentially means):
>   FileStream fs = null;
>   try
>   {
>    fs = File.Create("SomeFile3.txt");
>   }
>   finally
>   {
>    if (fs != null)
>    {
>     fs.Close();
>    }
>   }

The generated code is actually  more like:

   FileStream fs = File.Create("SomeFile3.txt");
  try
  {
   //
  }
  finally
  {
    IDisposable(fs).Dispose;
  }

-- 
Marc Rohloff [TeamB]
marc rohloff at myrealbox dot com
Technical Details
Message-ID: <8pqa860s7xbv.dlg@marcrohloff.40tude.net>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!in.100proofnews.com!in.100proofnews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4152442d$1@newsgroups.borland.com> <415253dc$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,371711e74f47af5a
X-Google-Attributes: gid1efe35,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Marc Rohloff [TeamB]" <"on request">
Subject: Re: 'File in use' error after File.Create()
Newsgroups: borland.public.csharpbuilder.language.csharp
User-Agent: 40tude_Dialog/2.0.13.1
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
References: <4152442d$1@newsgroups.borland.com> <415253dc$1@newsgroups.borland.com>
Date: Thu, 23 Sep 2004 20:43:34 -0400
Message-ID: <8pqa860s7xbv.dlg@marcrohloff.40tude.net>
NNTP-Posting-Host: 4.131.32.176
X-Trace: newsgroups.borland.com 1095986519 4.131.32.176 (23 Sep 2004 17:41:59 -0700)
Lines: 32
X-Authenticated-User: mrohloff
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!in.100proofnews.com!in.100proofnews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail