0

I am using a python command shutil.rmtree(dest,ignore_errors=True) to remove files from .metadata folder which was generated when eclipse is launched.

This .metadata folder has .log file, .lock file and a folder which has plugins.

When I use this command to delete files inside this .metadata folder .log file and plugins folder gets deleted but not .lock folder. It throws an error saying that the process can't be accessed since it is used by another process.

Is there a way I can delete this lock file using python command or by using a batch script?

SGhaleb
  • 979
  • 1
  • 12
  • 30
Sai
  • 73
  • 1
  • 10
  • 1
    no you cannot, it's not a python problem it's a windows feature. Quit eclipse you will be able to delete thos efiles. – Jean-François Fabre Feb 08 '17 at 15:14
  • Your OS is preventing Python from deleting those files. This isn't a Python problem; this is how your OS is supposed to work. Those files are still in use, the original process doesn't want them to disappear. – Martijn Pieters Feb 08 '17 at 15:19
  • There are a lot of important files in the .metadata for a workspace. You will do a lot of damage to the workspace deleting things in the metadata. – greg-449 Feb 08 '17 at 15:24
  • As I have already mentioned I want to delete one .metdata folder and replace that with other .metadata file.Please suggest a way to accomplish this.I have to delete a .metadat folder at c:\work\jobs and replace that with .metadata folder present at c:\work.Will I be able to do that? – Sai Feb 08 '17 at 15:51
  • How to quit eclipse @Jean-FrançoisFabre – Sai Feb 08 '17 at 16:03

0 Answers0