Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sharing violation when attempting to delete folder

Status
Not open for further replies.

mwitwer

Programmer
May 14, 2002
13
US
I have a program that creates a new folder and copies paradox files into the folder when you create a new "office". This all works great. However, when I delete an "office", I am unable to delete the folder. All of the files within the folder were deleted without an problems. Attempting to delete the folder itself does nothing. A call to RemoveDir returns false, and RmDir returns an IOResult of 32 (sharing violation). I also noticed that I cannot delete the folder from Windows Explorer while my app is running (get the sharing violation there, too). It is a single-user, local application. Does anyone have any suggestions as to how I could get around this sharing violation error so that I can actually delete the folder itself?

Thanks
 
Hi,

After you remove your files, your application still locks the directory, just change to another directorie and remove the dir after the change of directories.

Steph [Bigglasses]
 
I changed the current directory, then removed the one I wanted to delete, but this did not work. There is still a sharing violation.

This folder I want to delete is a subdirectory that has been created by the app under the app's main dir. Is there a way that I can force a delete of this folder, sharing violation be damned?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top