LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-22-2005, 03:21 PM   #1
un shiza
LQ Newbie
 
Registered: Mar 2005
Posts: 7

Rep: Reputation: 0
Question What constitutes an inode change?


I'm working on a script that archives files/directories and would like to do by "creation time". The closest thing to this is ctime, which is the time the inode was last changed. How often does this happen and what causes an inode change?
 
Old 09-23-2005, 03:28 AM   #2
primo
Member
 
Registered: Jun 2005
Posts: 542

Rep: Reputation: 34
Let's see man 2 stat:

Code:
struct stat {
	  dev_t 	st_dev;      /* device */
	  ino_t 	st_ino;      /* inode */
	  mode_t	st_mode;     /* protection */
	  nlink_t	st_nlink;    /* number of hard links */
	  uid_t 	st_uid;      /* user ID of owner */
	  gid_t 	st_gid;      /* group ID of owner */
	  dev_t 	st_rdev;     /* device type (if inode device) */
	  off_t 	st_size;     /* total size, in bytes */
	  blksize_t	st_blksize;  /* blocksize for filesystem I/O */
	  blkcnt_t	st_blocks;   /* number of blocks allocated */
	  time_t	st_atime;    /* time of last access */
	  time_t	st_mtime;    /* time of last modification */
	  time_t	st_ctime;    /* time of last change */
 };
Any change on any of these inode's entries cause an inode's change.

st_mode: chmod(2), fchmod(2)
st_nlink: link(2) and unlink(2), used by ln(1)
st_uid: chown(2), fchown(2)
st_gid: same as above. On the command line: chgrp(1)
st_size: write(2), truncate(2), etc
st_blocks: same as above
st_atime & st_mtime: utimes(2) and utimes(3), used by touch(1)

Just take a look at the manpage
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
resize / change inode size for partition? tinksmartbstupi Linux - Software 2 05-24-2009 08:54 AM
iNode number, how does it change? saudoi Solaris / OpenSolaris 4 05-22-2005 04:38 AM
What can change an inode number? nc101 Linux - General 2 01-03-2005 10:29 AM
Bash script to change a filename associated with an inode index number. Ziv Programming 22 06-19-2004 08:41 AM
why did this inode change? jlangelier Linux - Security 1 08-10-2003 09:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration