Removing symbolic links for source file in C

I am writing a C program that uses * NIX system calls. Now, when the user causes the deletion of a specific file, I want to delete all the symbolic links created in the file, as well as delete. How can this be achieved?

+3
source share
2 answers

There is no way to get a list of symbolic links pointing to a specific file, save the “hard way”, IE will go through the entire file system recursively (or some subset of the file system in which you know the symbolic links in) and determine if any either a solution for this file. You probably would rather use outsourcing for a utility find.

+4

, , , . "", . unlink() .

+4

All Articles