目前在K Linux的書。看到filesystem這邊產生了疑問:
Symbolic Link書上的解釋:是一個指向檔案的pointer, Linux會查那個pointer並找到該
檔案資料
(Symbolic link is a pointer to another filename. When Linux opens a
symbolic link, it reads the pointer and then finds the intended file that
contains the actual data.
Hard Link: It is another directory entry for an existing file
所以Hard Link是有在檔案系統中存在的,某個檔案的值 一定代表某個檔案
而Symbolic Link只是一個pointer 指向某個檔案 所以會出現pointer找不到檔案變破損
連結
用Windows來理解就是 Hard Link是檔案系統的進入點, 而Symbolic Link有點像桌面上的
超連結 這樣理解正確嗎?
另, Linux的inode到底是什麼?和Hard Link有什麼不一樣?
煩請各位回答 謝謝
作者:
bitlife (BIT一生)
2015-08-03 11:03:00以資料結構解釋 檔案A,B是hard link,都指向 inode_0而soft link C則是在目錄資料內存放A(orB)的路徑(絕對or相對), dir_entry_A -> inode_0 dir_entry_B -> inode_0dir_entry_C -> dir_entry_A (or B)