in reply to Please explain -C / inode

I believe the -C option relative to a filename represents the ctime of the inode. Don't ask me what this means, I'm just reading about it in a book (Perl Cookbook). I've read far enough to get to the following line: "The ctime is not the creation time; there is NO way under standard UNIX to find a file's creation time." Bummer since that is what I think you're trying to do. I'm not saying that it can't be done from personal experience, I'm just stating what was in the book! Below is a brief explanation as stated in the Perl Cookbook.

An inode (index-node) is an entry in the index that are relative to a set of data blocks. The inode is a flat file and is addressed by number. An inode acts as a pointer to a specific set of data blocks, but also contains information on the type of things it represents (directory, plain file, etc).

The inode contains many fields, but of relevance to this post: atime, ctime, and mtime.

atime - updated every time pointer to the file's data blocks is followed and the file's data is read

ctime - updated each time the file's inode changes

mtime - updated each time the file's data changes

You might also want to read up about File::Stat, which provides an interface to all of these values. It's a very effective method of obtaining information about a certain file.

HTH, Eric

Replies are listed 'Best First'.
Re: Re: Please explain -C / inode
by Elliott (Pilgrim) on Jul 01, 2002 at 22:48 UTC
    Thank you for this info. It seems fairly clear that if I want a creation date, I'll have to write it myself somewhere. (Just wish I'd thought of it BEFORE I created the files :-)

    My fundamental question is now answered but I am still curious... what on earth is -C for?
      The -C is the operator for the ctime stat field. They (-C and ctime) both mean the file's (inode) change time. I can't explain it any further. Perhaps one of the other monks?

      what on earth is -C for?

      "The field st_ctime is changed by writing or by setting inode information (i.e., owner, group, link count, mode, etc.)." -- stat(2)

      Next time, maybe you should try Google first.

      - Yes, I reinvent wheels.
      - Spam: Visit eurotraQ.
      

        Thank you. Does the "etc" include overwriting the file from within Perl, appending to the file or overwriting it by FTP?

        I appreciate you sharing your knowledge - even when you are repeating my original question.