Re: Do hard links have creation dates?
Re: Do hard links have creation dates?
- Subject: Re: Do hard links have creation dates?
- From: Dave Carrigan <email@hidden>
- Date: Mon, 16 Mar 2009 08:42:50 -0700
On Mar 16, 2009, at 8:27 AM, Oleg Krupnov wrote:
If I create a file and then a hard link to that file, is there a way
to distinguish their creation dates (e.g. to sort by date)?
A hard link is simply an entry in the directory that points to the
physical file. No matter how many hard links there are, there is only
a single file, so what you're asking for doesn't really make sense
within the context of Posix hard links.
It appears that in Terminal and in Finder, the both files appear to
have the same creation date. But I wonder if I'm missing some other
way to distinguish the dates.
There is only one file, and thus only one creation date.
Another way to think of it is that all files are hard links; it's just
that most files have a hard link count of 1. When you create a new
link, you increase the hard link count for that file by 1. When you
remove a hard link by calling unlink(2), then you decrease the hard
link count by 1. When the count reaches zero, the system reclaims the
file's blocks.
--
Dave Carrigan
email@hidden
Seattle, WA, USA
Attachment:
PGP.sig
Description: This is a digitally signed message part
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden