I created a file called my_file and verfied the inode value. I opened he file again and re-write some more contents. When I viewed the inode size. It varied from the previous inode size. Why isnt the inode same for the file my_file after re-writing on it ?
Asked
Active
Viewed 76 times
1
-
What tool did you use to modify the file? Some editors will write a new file and rename it, deleting the old. – Charles Jan 11 '14 at 23:36
-
@Charles : I used the vim editor. You were right when I use cat to modify the file , the inode values are not changed – Angus Jan 13 '14 at 04:13
-
@Charles: But why does the vim editor deletes and creates once again a new file ? . Please help me understand . – Angus Jan 13 '14 at 04:19
-
As I didn't write vim, I can't answer for sure, but: file renames are atomic, while file rewrites aren't. A program crash halfway through a new file write won't trash the original file. – Charles Jan 13 '14 at 06:19