-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathln_notes
More file actions
47 lines (43 loc) · 1.9 KB
/
ln_notes
File metadata and controls
47 lines (43 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Differences between hard-links and soft-links:
Hard:
! filename ! inode # !
+--------------------+
\
>--------------> ! permbits, etc ! addresses !
/ +---------inode-------------+
! othername ! inode # !
+---------------------+
Soft:
! filename ! inode # !
+--------------------+
\
.-------> ! permbits, etc ! addresses !
+---------inode-------------+
/
/
/
.----------------------------------------------'
(
'--> !"/path/to/some/other/file"!
+---------data-------------+
/ }
.~ ~ ~ ~ ~ ~ ~ }-- (redirected at open() time)
( }
'~~> ! filename ! inode # !
+--------------------+
\
'------------> ! permbits, etc ! addresses !
+---------inode-------------+
/
/
.----------------------------------------------------'
(
'-> ! data ! ! data ! etc.
+------+ +------+
Here, we see that although softlink.file accesses the same data as basic.file
and hardlink.file, it does not share the same inode (73479 vs 73478), nor does
it exhibit the same file permissions. It does show a new permission bit: the 'l'
(softlink) bit.
If we delete basic.file, then we lose the ability to access the linked data
through the softlink. However, we still have access to the original data through
the hardlink.