Tariq Kamal
Tariq Kamal

Reputation: 496

Is there a system call to find if a certain path is a regular file or a hard link in unix

If two paths have the same inode number; one of them is a hard link. Do we have a system call to know which one of them is a hard link. Or any other programatic way in C.

Upvotes: 0

Views: 38

Answers (1)

Maxim Egorushkin
Maxim Egorushkin

Reputation: 136208

If two paths have the same inode number; one of them is a hard link.

A file name is a hard link by definition in Unix/Linux. You cannot distinguish between hard links apart from their paths.

Upvotes: 1

Related Questions