Board index » delphi » Unable to remove directory after exclusively opening table

Unable to remove directory after exclusively opening table

Hi,

My issue is, if I open a table for exclusive use then close the table, I am
able to delete the contents of the subdirectory but I am completely unable
to delete the subdirectory that contained the table that I opened.  If I
close my program, it then seems to release the OS level lock on the table
and I may delete the directory.

This issue, it only occurs on NT/2000, Win9x/ME does not exhibit this
behavior.

You can reproduce this issue easily if you open a table in Database Desktop
7 and then close the table, but leave DBD open.  WIth DBD open, go to
Explorer (or whatever) and try to delete the subdirectory that holds the
table you just opened.  The directory and its contents will be emptied but
you will receive a sharing violation error when it attempts to remove the
directory itself.

Does anyone know if this is a "feature" of the BDE or is there a
property/set of steps I need to perform in Delphi 5 for my app to do what I
am asking?  I have tried various steps (separating the table opening into
its own session/database/table, moving current/working directory, etc.) but
obviously for no success.

Thanks!

- Shawn.

 

Re:Unable to remove directory after exclusively opening table


Barry,

I did close the table.  I am sorry if I was unclear in my explaination.  I
still believe that this group is more applicable for the issue as the
methodology involved for removing the directory is arbitrary; the engine
still retains a OS level lock which is the issue.

Thank you for your response.

- Shawn.
"Barry L. Birch" <amicus-bi...@gettheleadout.worldnet.att.net> wrote in
message news:8of1rd$37u3@bornews.borland.com...

Quote
> Shawn:
> << .. I am completely unable to delete the subdirectory that contained
> the table that I opened.  >>

> IIRC, you can not remove a directory as long as it is open. You will
> need to close & leave it before trying to remove it.

> Your question would attract more/more savvy replies if you posted to
> borland.public.winapi.

> --
> Barry L. Birch
> AMICUS custom software

> Please reply to newsgroups only unless invited to respond privately

Other Threads