Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I encountered a strange problem today. When compiling a C++ project using a Makefile, I generate a file called temp.log. It contains info about warnings should they be printed. However, I accidentally interrupted the compilation process, and now I cannot access the temp.log file.

Here are the things I've tried:

  • Delete the file in explorer. It disappears from the folder, but it's impossible to create a new file with the same name except for when I run my Makefile, but it fails after that since no data can be written to it.
  • chmod it to 0777 in MSYS. Access denied.
  • Change the owner to my account. Access denied.
  • Try to access it through the command prompt run as administrator. Access denied.
  • Switch to the hidden Administrator account and access it that way. Access denied.
  • Use takeown as the admin account. Access denied...

I'm at my wit's end. I have absolutely no idea what's going on. Any help would be greatly appreciated.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

When I run in to this normally it is because something has a exclusive handle on the file

What I do is I use Process Explorer and click the binoculars on the tool bar to open the find menu. From there you can type in the name of the file or folder and it will list all processes that have a open handle to that file.

enter image description here

One you find the offending program you can either terminate the program or just terminate the filehandle by right clicking on it once you have the process selected.

share|improve this answer
    
Wow! This actually worked! Thanks a lot! collect2.exe (from GCC) had somehow remained active and had an exclusive handle. –  Merigrim Feb 12 '13 at 19:55

A couple of things you can try:

  • Check the filesystem with chkdsk.

  • Delete the file on reboot with Unlocker, KilBox, Boot Deleter, etc.

  • Boot from another partition or a Live CD (e.g., Ubuntu 12.04) and delete the file from there.

share|improve this answer
    
Thanks, I'll try this on my next reboot (which will be in a couple of hours). –  Merigrim Feb 11 '13 at 23:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.