Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RemoveDirectory() error access denied ERROR_ACCESS_DENIED - how to find out who accesses it?

100 views
Skip to first unread message

peach...@gmx.ch

unread,
Jun 10, 2009, 11:18:35 AM6/10/09
to
Hi,

When deleting a folder with WIN32 API RemoveDirectory(), it fails and
the last error is ERROR_ACCESS_DENIED (error code 5). How can I find
out, what process still accesses it? Is there a debug technique for
that?

Thanks,
Peter

Paul G. Tobey [eMVP]

unread,
Jun 10, 2009, 12:27:25 PM6/10/09
to
Is the directory empty? Is the directory read-only? Those are the only two
things that I can recall having problems with...

Paul T.

<peach...@gmx.ch> wrote in message
news:bfca9d7e-73dc-49cd...@k20g2000vbp.googlegroups.com...

PeterV

unread,
Jun 11, 2009, 2:41:59 AM6/11/09
to
The directory is empty and not read-only.

I think "access denied" means another process has this directory as
its working directory. Do the following example in the root directory
of your device:

mkdir hello
cd hello
rmdir \hello -> fails!
cd ..
rmdir \hello -> works!

So: if the cmd has the working directory "hello", it fails - otherwise
it's possible. Typically Windows :-( ! How can I find out, which
process occupies my directory to remove?

Paul G. Tobey [eMVP]

unread,
Jun 11, 2009, 11:26:33 AM6/11/09
to
There's no concept of "working directory" native to Windows CE, so it's
something that the shell itself is doing. I don't seem to have the source
for the shell, so I'm not sure what it would be, but, based on your testing
you've got to be right. I don't think that there's any way to find out who
is interfering, at least no way that's reasonable. You could write a
filesystem filter and install it and have it provide some means to ask it
who is enumerating the contents of a folder or who has a file in a folder
open, etc. If you don't have any console applications running, what
happens?

Paul T.

"PeterV" <peach...@gmx.ch> wrote in message
news:25f0a184-49f8-49b8...@37g2000yqp.googlegroups.com...

0 new messages