Inode number of the particular file gets changed.

Bug #1439201 reported by pankaj
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pigment (Ubuntu)
Opinion
Undecided
Unassigned

Bug Description

  *** SORRY FOR MY BAD ENGLISH ***

*** I was doing my daily exercise on the topic of timestamps.

        --> How the timestamps of the particular file gets changed, when we do some changes in that particular file.

        1)--> ex:- cat
              Access time is changed.

        2)--> ex:- vi
                   If some modification is made in that particular file with the help of vi editor.
                   then how the access,modification,change time of the particular gets changed.

        3)--> ex:- chmod
                   If we do chmod to a particular file only the change time of that file gets changed.

        4)-->ex:- touch
           If we touch a file, then all the timestamp get changed.

       *** I was using stat tool to check all the timestamps ***

                                               *************************************************************************************************
       HERE IS THE PROBLEM WHICH I AM FACING EVERYTIME,WHEN I DO STAT TO THAT PARTICULAR FILE.
                                               *************************************************************************************************
--> The inode number of that file gets changed, as I do any modification to that file.

tux@ubuntu:~/pankaj$ uname -r
3.11.0-15-generic

tux@ubuntu:~/pankaj$ cat /etc/issue
Ubuntu 12.04.4 LTS \n \l

tux@ubuntu:~/pankaj$ touch test
tux@ubuntu:~/pankaj$ ls
test
tux@ubuntu:~/pankaj$ stat test
  File: `test'
  Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: 801h/2049d Inode: 56640 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ tux) Gid: ( 1000/ tux)
Access: 2015-03-27 11:40:26.926255729 +0530
Modify: 2015-03-27 11:40:26.926255729 +0530
Change: 2015-03-27 11:40:26.926255729 +0530
 Birth: -

tux@ubuntu:~/pankaj$ cat test
hello world

tux@ubuntu:~/pankaj$ stat test
  File: `test'
  Size: 12 Blocks: 8 IO Block: 4096 regular file
Device: 801h/2049d Inode: 56643 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ tux) Gid: ( 1000/ tux)
Access: 2015-03-27 11:43:48.011048224 +0530
Modify: 2015-03-27 11:43:48.011048224 +0530
Change: 2015-03-27 11:43:48.783020869 +0530
 Birth: -

tux@ubuntu:~/pankaj$ cat test
hello world hello world
_____________________________________________________________________________

*** No changes made now in it, then the inode remains same.

tux@ubuntu:~/pankaj$ stat test
  File: `test'
  Size: 12 Blocks: 8 IO Block: 4096 regular file
Device: 801h/2049d Inode: 56643 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1000/ tux) Gid: ( 1000/ tux)
Access: 2015-03-27 11:43:48.011048224 +0530
Modify: 2015-03-27 11:43:48.011048224 +0530
Change: 2015-03-27 11:43:48.783020869 +0530
 Birth: -
tux@ubuntu:~/pankaj$

*************************************************************************************************

-> When I touched file named test & did stat on that file, the inode number was 56640.
-> But as I edit the same file and add something to it, its inode number changed again to 56643.
-> Inode number should not change. then how come it gets changed !!!

pankaj (pankajshama26)
Changed in pigment (Ubuntu):
status: New → Opinion
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.