Re: Access denied when trying to move directory in use



Hi Dave,

Sorry for the late response. I am sick at home the whole last week.

Below is the further comment I got from the FS team:

"I was using the term "file" generically. I meant file or directory.

I think something else is going on here. First off, FILE_DELETE_ON_CLOSE
and FileDispositionInformation are NOT the same thing.

There are really two parts to delete. The first part is to logically
delete the file. This consists of the file system marking the file as
deleted and then waiting for the last handle to close. When a file is
marked as deleted, many operations (including new opens) fail. Once the
last handle as closed, the actual delete of the file can take place.

When you open a file with FILE_DELETE_ON_CLOSE, the file is left as is.
Neither part of delete is done. The only thing done is to remember that
when this handle is closed, the file should be deleted. All operations on
the file will proceed as normal. When the handle marked as delete on close
is closed, the file is logically deleted. If that handle was the last
handle, the file will also actually be deleted.

When you use FileDispositionInformation to set a file to deleted, the file
is logically deleted right then. Any new opens for the file and many other
operations will fail. The file system will not complete the actual removal
of the file until the last handle is closed, though.

So when you open a file with FILE_DELETE_ON_CLOSE, it should have no effect
on whether you can rename it. I cannot find any difference in this code
across the various versions of Windows. It seems like there is something
else happening on the XP SP2 system. Is there perhaps some other filter
driver that may be changing behavior? Or is there application maybe not
doing exactly what they are saying it is doing?"

Hope this helps.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

.



Relevant Pages

  • Re: C2872 IServiceProvider ambiguous symbol - migrating C++/MFC App with /clr to Visual Studio 2
    ... Infinite thanks for yet another excellent response. ... "typedef interface IServiceProvider IServiceProvider;" ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Intermittent work in UI thread
    ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.vc.mfc)
  • Re: Intermittent work in UI thread
    ... then the issue here is that you would have a timer handler something like ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.vc.mfc)
  • Re: Abort a download
    ... response output finished. ... enough for the raw HTTP communication. ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Inserted Identity Values in SQL 2005
    ... Thanks for your response. ... environment who has a SQL server 2005 merge replication, ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.data.ado)