I've got a scripting task that needs me to work off the creation time of a file.
I've been caught out before by 'ctime' being change time, rather than 'create time'.
So I thought I was just stuck - however, I've noticed that the Windows 'file creation time' attribute .... actually looks correct. Which has me confused, because I can't see this value from 'Unix side' seemingly at all. I can't tell how Windows knows what the right value is.
Is anyone able to enlighten me? Where's creation time stored, and is there a way to access it from Unix?
UNIX simply does not provide any API to get this information. Sorry.
NFS4 theoretically defines attribute time_create; but it cannot be exposed through normal UNIX filesystem API. You would need some custom client to fetch it.
I also do not know whether NetApp supports it.
From: toasters-bounces@teaparty.net [mailto:toasters-bounces@teaparty.net] On Behalf Of Edward Rolison Sent: Tuesday, July 14, 2015 2:11 PM To: toasters@teaparty.net Subject: "Created Date" on CIFS shares
I've got a scripting task that needs me to work off the creation time of a file.
I've been caught out before by 'ctime' being change time, rather than 'create time'.
So I thought I was just stuck - however, I've noticed that the Windows 'file creation time' attribute .... actually looks correct. Which has me confused, because I can't see this value from 'Unix side' seemingly at all. I can't tell how Windows knows what the right value is.
Is anyone able to enlighten me? Where's creation time stored, and is there a way to access it from Unix?
On Tue, Jul 14, 2015 at 01:27:32PM +0200, Borzenkov, Andrei wrote:
UNIX simply does not provide any API to get this information. Sorry.
If mounted by NFSv4 then acl's should be exposed to unix clients. Both linux and solaris have setfacl and getfacl. For linux you need to install the acl package it appears if not done already.
I can find no mention of acls in the find man page on my linux which is surprising.
There is a python library called pylibacl that could be useful if you know python. Probably a perl one as well.
There are C library routines as well if you want to use those.
Disclaimer: I have no idea what WAFL does with this stuff and have never used it.
Regards, pdg