The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ftp files -- but keep the original timestamp Perderabo Answers to Frequently Asked Questions 0 07-23-2006 11:43 AM
ftp - get file and keep original timestamp? frustrated1 Shell Programming and Scripting 2 03-15-2006 01:31 PM
Create file with old timestamp Kris_Kart_101 UNIX for Dummies Questions & Answers 2 10-14-2005 01:18 PM
Sort - original order .... Help olga UNIX for Dummies Questions & Answers 2 06-01-2005 08:26 AM
Original Path therealtiger UNIX for Dummies Questions & Answers 5 05-18-2001 01:41 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-20-2008
aster007 aster007 is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 11
How to get the original create timestamp?

How do i get the original create timestamp in Unix?

I tried "ctime" but this gives me the change timestamp which changes with changes to inode (owner, permissions, etc.).

I need the timestamp when the file was originally created.

Thanks in advance!
  #2 (permalink)  
Old 08-20-2008
redoubtable redoubtable is offline
Registered User
  
 

Join Date: Aug 2008
Location: Portugal
Posts: 242
I believe there is no embedded way of knowing the original timestamp. The ext2/ext3 inode structure looks like this:
Code:
struct ext2_inode {
        __u16   i_mode;         /* File mode */
        __u16   i_uid;          /* Low 16 bits of Owner Uid */
        __u32   i_size;         /* Size in bytes */
        __u32   i_atime;        /* Access time */
        __u32   i_ctime;        /* Inode change time */
        __u32   i_mtime;        /* Modification time */
        __u32   i_dtime;        /* Deletion Time */
        __u16   i_gid;          /* Low 16 bits of Group Id */
        __u16   i_links_count;  /* Links count */
        __u32   i_blocks;       /* Blocks count */
        __u32   i_flags;        /* File flags */
(...)
No reference to what you wish.
  #3 (permalink)  
Old 08-20-2008
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,951
created timestamp for a file is not stored anywhere ( in the inode ) you could retrieve only modified time stamp, last accessed timestamp
  #4 (permalink)  
Old 08-20-2008
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,913
The answer depends on your filesystem. Older filesystems UFS, ext2, etc do not store this information. Most of the newer filesystems do keep this information somewhere within their metadata, e.g. ext4 in crtime (creation timestamp), UFS2 in di_birthdate.
Closed Thread

Bookmarks

Tags
create timestamp, ctime, timestamp

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:37 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0