0

I have a task of authenticating a text license file wrt its creation date(file also contains the creation date as a content field). If the licence is being copied to another location then I could validate the creation date with the creation date contained inside the file.

Java 7 gives a handy package "NIO" for such operation but unfortunately linux doesn't keeps any track of file creation date.

Any other way around will be helpful .

Maverick
  • 218
  • 1
  • 5
  • 18
  • Possible duplicate, this is answered here: http://stackoverflow.com/questions/21033928/how-to-get-proper-file-creation-date-of-file – anquegi May 21 '15 at 09:32
  • No, my question is different, almost checked all the threads but still searching for the perfect one. – Maverick May 21 '15 at 09:41
  • If the file is stored on a filesystem which supports extended attributes you could create one with `xattr` and deal with that your self. I'm not sure if the attributes would survive a `cp file_from file_to`. Otherwise have a look at this post which explains why there is no `creation time` http://moiseevigor.github.io/software/2015/01/30/get-file-creation-time-on-linux-with-ext4/ – SubOptimal May 21 '15 at 13:43
  • I don't see how knowing the file creation date validates or invalidates the data contained in the file. Either the data making up the cert is valid or it isn't. Just keep a SHA-1 or similar hash of the contents. And as others have noted, this **is** a duplicate question. Added "Java" doesn't change that. – Andrew Henle May 21 '15 at 18:37

0 Answers0