Delete link to file without clearing readonly bit

Posted by Joshua on Stack Overflow See other posts from Stack Overflow or by Joshua
Published on 2010-06-16T17:27:25Z Indexed on 2010/06/18 3:23 UTC
Read the original article Hit count: 319

I have a set of files with multiple links to them.

The files are owned by TFS source control but other links to them are made to them. How do I delete the additional links without clearing the readonly bit.

It's safe to assume:

  • The files have more than one link to them
  • You are not deleting the name owned by TFS
  • There are no potential race conditions
  • You have ACL full control for the files
  • The machine will not lose power, nor will your program be killed unless it takes way too long.

It's not safe to assume:

  • The readonly bit is set (don't set it if its not)
  • You can leave the readonly bit clear if you encounter an error and it was initially set

Do not migrate to superuser -- if migrated there the answer is impossible because no standard tool can do this.

© Stack Overflow or respective owner

Related posts about Windows

Related posts about tfs