Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get File in use error when trying to delete
Message
 
 
To
09/03/2010 10:20:26
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01453449
Message ID:
01453450
Views:
52
>Hello all,
>
>These are my steps:
>1.) CD (my folder location)
>2.) CLOSE TABLES ALL
>3.) CLOSE DATABASES ALL
>4.) CD (new folder location)
>5.) ERASE (my folder location\*.*)
>
>Error 3: File in use
>
>I use a program called Unlocker so I can see what has files locked at certain times. I use Unlocker on "my folder location" and it says that dbcxmgr.vct and dbcxmgr.vcx appear to be in use in "my folder location".
>
>Does anyone know of a way that I can force close dbcxmgr.vct and dbcxmgr.vcx in "my folder location" since "CLOSE ALL" AND "CLOSE DATABASES ALL" doesn't seem to get the job done?
>
>OR maybe even how to delete an entire folder with a lot files in it whether it's being used by something else or not.
>
>Thanks in advance!

Matt,

In VFP8 and up you can put erase command into TRY/CATCH block, so it would not give you an error.

Alternatively, you can try deleting each file individually (in try/catch as well) - this way you would be able to delete everything except for used files.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform