I have a set of files with several links to them.
Files belong to the TFS source, but other links are added to them. How to remove sitelinks without clearing the readonly bit.
We can safely assume:
- Files have more than one link to them
- You do not delete the name belonging to TFS
- There are no potential race conditions.
- You have full ACL control for files
- The machine will not lose power, and your program will not be killed if it does not take too long.
It is unsafe to assume:
- the readonly bit is set (do not set it if it is not)
- You can leave the readonly bit clear if you encounter an error and was originally set
Do not transfer to the superuser - during its migration, the answer is impossible, because no standard tool can do this.
On a hypothetical * nix system that requires permission to write to a file to delete it, there is a solution that includes fchmod (). However, a system exhibiting this behavior is a Windows system.
source share