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
d...@rudedog.org
Seattle, WA, USA

Attachment: PGP.sig
Description: This is a digitally signed message part

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to