Re: IO.File.Delete weirdness (undead files)

From: Fergal Ó Ceallaigh (fergaloc_at_ryarc.spam-me-not.com)
Date: 11/18/04


Date: Thu, 18 Nov 2004 15:44:21 +1100

Hi, I found the reason for this. It wasn't enough when using the Video
object of Microsoft.DirectX.AudioVideoPlayback.Video to set it to Nothing, I
had to call .Dispose() everytime I used it to fully release the file.

- Fergal

www.ryarc.com

"Fergal Ó Ceallaigh" <fergaloc@ryarc.spam-me-not.com> wrote in message
news:uey5oOSzEHA.1404@TK2MSFTNGP11.phx.gbl...
> Hi,
>
> As part of my app I allow users to copy files into a 'project' (in
> reality, just a regular folder). The copying works fine, however I am
> running into consistent problems when trying to later delete files that I
> have copied. Often I am finding that the file is being locked "by another
> process" or I get silly "permission denied" problems (Its a Windows Forms
> app and its being run by an admin). Even weirder still, when debugging
> and stepping through the IO.FILE.DELETE(FileName) I note that the file is
> not deleted even tho the line doesn't throw an exception. The file
> remains in place until after the application itself terminates making it
> impossible for me to overwrite or update the files with newer versions
> etc, as per the user's needs. Clearly, a request to delete is being
> delayed and queued in some fashion. I'd like to be able to see why the
> file is being locked and get .net to understand that when I say delete the
> file; I mean delete the file now. Can someone help shed light on what is
> happening here and how I might work around this?
>
>
> Thanks much,
>
> Fergal O' Ceallaigh
> www.ryarc.com
>
>
>
> Other info:
>
> I do thumbnail the files as the user works with them but am careful to
> make sure that the objects used to examine the file are released before
> deletion.
> The Folder In which I am doing the file operations (its less than 256
> characters) C:\Documents and Settings\Fergal\My Documents\Visual Studio
> Projects\RyarcMother\bin\WorkingDirectory\e31da847-9f0d-499c-ac94-9514ce3df31e\FBE7CB33-CBF1-410E-AAD7-DD008A63A1BB\
>



Relevant Pages

  • Re: C# forms - this.dispose? want to close automatically when done.
    ... In general there's no reason to call Dispose on your Form object. ... Does this app need a UI anyway? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: A Tale of Two Memory Managers (long)
    ... do you need to dispose MemoryStream? ... I think the reason for introducing GC is performance, ... There was a time we had 640k of memory to access. ... the approach of a linked list with all free blocks of your app would be ...
    (borland.public.delphi.non-technical)
  • Re: Nikon D 90 Brochure
    ... Per the strobist it is due to the sensor heating up. ... but I really wonder if that *is* the reason ... ... bucket brigading regardless of resolution. ... it would be classified as a high end video device ... ...
    (rec.photo.digital.slr-systems)
  • Re: Bungie 2007
    ... Adam Rowney wrote: ... I think the only reason you didn't get many passers by helping out with tents was because by the end of the night there were several refugees sleeping in the bigtop due to similar problems and many very wet jugglers in their beds. ... Sun, buttercups, new games, having company every dinner time, late night pancakes on a saw blade and tractor wheel, cuddles, new friends, old friends ... I would even go as far as politely requesting that anyone with video footage uses either excerpts only as part of another video or just deletes it altogether. ...
    (rec.juggling)
  • Re: Organ donation
    ... the previous owner, being dead, has no call on it whatsoever. ... reason why removing organs should be disrepectful to the feelings of ... Using the organs to help others is ... dispose of an estate to strangers rather than to family. ...
    (uk.philosophy.humanism)