Quote:
Originally Posted by
srirammanohar
Hi,
I have created a file a.txt in Redhat Linux.
Inode number for a file get changes every time i update the file using vi editor , gedit etc.
Is there any setting that can be made , such that inode number never gets changed?
Or if we cannot restrict from inode number getting changed , is there any way to identify the file uniquely as inode number does.
I need a way to differentiate between a.txt that is modified and a.txt that was created after renaming the earlier a..txt to a.txt.1
Kindly reply
Thanks in Advance.
Sriram
If there are multiple links to a file,
vi file should not change the i-node number. If there is only one link to a file and you make any changes to the file using
vi, it is more efficient to rename the temp file to the final resting place rather than copy the temp file onto the original file and then remove the temp file.
Why do you care if the i-node number changes? Why isn't the file's name (
a.txt) sufficient for identifying the file?
(Note that
ls -i and
ls -li will also give you the i-node number even on systems that don't have the
stat utility.)