Question on inode - Ext3 FS

David Woodhouse dwmw2 at infradead.org
Wed Nov 26 09:34:19 UTC 2008


On Wed, 2008-11-26 at 10:11 +0530, lakshmi pathi wrote:
> I have noticed that whenever you edit a file content,a new inode
> number is assigned with the File.
> But Sometime file changes the inode number,Sometimes it remains as older inode.
> 
> Can anyone please let know the concept behind this - modifing content
> changes the file's inode but not all the time?

It depends on your editor. If it just truncates and overwrites the
existing file, the inode number will be the same. If it writes a new
file and then renames it over the old one, it'll get a new inode number.

[dwmw2 at macbook ~]$ ls -i foo.c
2506954 foo.c
[dwmw2 at macbook ~]$ nano foo.c
[dwmw2 at macbook ~]$ ls -i foo.c
2506954 foo.c
[dwmw2 at macbook ~]$ emacs foo.c
[dwmw2 at macbook ~]$ ls -i foo.c
2506950 foo.c
[dwmw2 at macbook ~]$ 

-- 
dwmw2




More information about the fedora-devel-list mailing list