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?
- A. Both links still work
- B. Both links break
- C. The symbolic link still works; the hard link breaks
- 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
- Why can a hard link not normally point to a directory or to a file on a different file system?
- Path /usr/local/bin/tool is opened on a Unix file system where every directory fits in one block, no inode or block is cached except the…
- A disk has 16 surfaces, 512 cylinders and 64 sectors per track. Sectors are numbered starting at 0, fastest over sectors, then surfaces…
- A disk has 8 platters (both surfaces used), 20,000 tracks per surface, 400 sectors per track on average and 512-byte sectors. What is its…
- Which of the following events causes a process to move from RUNNING to READY (not to WAITING)?
- How many of these transitions are possible in the standard five-state model (new, ready, running, waiting, terminated)? 1. waiting →…