Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #4829

Re: c# .net 4 unable to move file - file in use by another process (by itself)

From Kaz Kylheku <kaz@kylheku.com>
Newsgroups comp.programming
Subject Re: c# .net 4 unable to move file - file in use by another process (by itself)
Date 2014-10-16 15:41 +0000
Organization Aioe.org NNTP Server
Message-ID <20141016083723.39@kylheku.com> (permalink)
References <4c284fb9-3878-43e0-9d11-85b7c33ce269@googlegroups.com>

Show all headers | View raw


On 2014-10-16, lachlann@gmail.com <lachlann@gmail.com> wrote:
> When i attempt to rename the file from .pending -> .failed i get an error
> "file is in use by another process". originally this service was
> multi-threaded so i assumed it was a collision with other threads however
> upon further investigation i've made it single-threaded and it is still
> failing. it even happens when stepping through the code using the debugger
> (VS2010). 
>
> I've moved all "file" logic into 3 methods:
> readfromfile
> writetofile
> movefile

Who closes the handle to release the file? Is it possible that you might be
leaving that responsibility to a finalization performed by the garbage
collector?

Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

c# .net 4 unable to move file - file in use by another process (by itself) lachlann@gmail.com - 2014-10-16 08:08 -0700
  Re: c# .net 4 unable to move file - file in use by another process (by itself) Kaz Kylheku <kaz@kylheku.com> - 2014-10-16 15:41 +0000
    Re: c# .net 4 unable to move file - file in use by another process (by itself) lachlann@gmail.com - 2014-10-16 12:59 -0700
  Re: c# .net 4 unable to move file - file in use by another process (by itself) Justin Marshall <lachlann@gmail.com> - 2015-03-24 12:12 -0700
    Re: c# .net 4 unable to move file - file in use by another process (by itself) CarolHudson <CarolHudson0@yahoo.com> - 2015-04-22 21:05 +0200
  Re: c# .net 4 unable to move file - file in use by another process (by itself) Queego <tonyhecht@gmail.com> - 2015-08-14 19:14 -0500

csiph-web