What happens when you create a hard link to a text file,and then you delete a text file? a) The hard link will also be deleted b) The hard link will exist although it will point to an emty file c) The hard link will exist, and you will be able to read the content of the text file d) The hard link will be undefined
Answers
Answer: The correct answer to the question is (b) The hard link will exist although it will point to an empty file
Explanation:
In order to understand what happens in this action, look at the following:
Hard link:
-It is a directory entry which associates a name with a file on a file system.
-Its role is that all directory-based file systems must have at least one hard link giving the original name for each file.
-In file systems when there is more than one link for the same file, hard links are associated with such files.
- Creating a hard link has the effect of giving one file multiple names (e.g. different names in different directories)
If a hard link is created for a text file. Then the original text file is deleted, then basically a copy of that file's name is created, in a sense that original file gets deleted.
That's why when you create hard link to a text file and then you delete the text file, it erases the entire, total data of the original file.
Hence, it ultimately erases the total data present.