I''m used to using fstat() and other calls to get atime, ctime, and mtime values, but I understand that the znode also stores a files creation time in crtime attribute. Which system call can I use to retrieve this information? -- Todd E. Moore Sun Microsystems Incorporated 443.516.4002 AIM: toddmoore72462 _______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
Mark Shellenbaum
2008-Aug-04 13:53 UTC
[zfs-discuss] How to get a file''s crtime attribute from a znode?
Todd E. Moore wrote:> I''m used to using fstat() and other calls to get atime, ctime, and mtime > values, but I understand that the znode also stores a files creation > time in crtime attribute. > > Which system call can I use to retrieve this information? >You can use the getattrat() or fgetattr() interface to retrieve the create time attribute. That interface returns an nvlist which has various supplemental attributes such as the create time. You must have a ZFS version 3 file system for that interface to work. If all you want is to see the create time then you can use "ls" to display it. $ ls -% all <file> -Mark