CS FundamentalsModerateGATE CS

A hard link and a symbolic (soft) link both point to file F. F is then deleted with `rm F`. What happens?

  1. A. Both links still work
  2. B. Both links break
  3. C. The symbolic link still works; the hard link breaks
  4. D. The hard link still reaches the data (link count was 2); the symbolic link now dangles

Correct answer: D. The hard link still reaches the data (link count was 2); the symbolic link now dangles

A hard link is another directory entry for the same inode; data is freed only when the link count reaches 0. A symlink stores a pathname, which no longer resolves.

More Operating Systems questions

Exams that ask this topic