0

I made a file management system in PHP for one of my clients. Following situation: User has pdf files on the server. Date should be creation date of the file. At the moment its the last modified date (as i assumed the files would be uploaded on the same day) Now, after some research on internet, i learned that linux does not save creation time information. Anyone ran into this problem yet, and whats the best solution/work around for this?

Last modified info is not the option. Because the files are delivered the day after the creation.

Savad KP
  • 1,513
  • 3
  • 27
  • 34
suspected
  • 7
  • 6
  • Read: http://stackoverflow.com/questions/4401320/php-how-can-i-get-file-creation-date – Ismael Miguel Feb 04 '16 at 11:52
  • Have you tried using `filemtime`? – YaBCK Feb 04 '16 at 11:52
  • How are the files created? Are they created by Your system? If yes, then You can store file creation time to database or into the filename itself (if it doesn't break Your naming conventions). – Roman Hocke Feb 04 '16 at 11:53
  • @ismael, thanks but i already read this topic. This only says "getting the creation time is not possible on linux systems". My question was if there was a workaround. – suspected Feb 04 '16 at 12:05
  • @roman the files are created at the mailing delivery company. So not at my customer. Im using 'filemtime' at the moment. Should of mentioned it. – suspected Feb 04 '16 at 12:07
  • 1
    Then your imagination is the limit! What @RomanHocke said are 2 methods, but there's plenty more. The thing is: store the creation time somewhere else. Heck, you can even make your own little file with the timestamp in it, for each file you create! – Ismael Miguel Feb 04 '16 at 12:08
  • @ismael the thing is im not creating the files. They are being delivered by the postal company. It are pdf files of registered mails. Else i could store them into the db ofcourse. – suspected Feb 04 '16 at 12:22
  • Then you have no way of knowing the creation time, since it can change during the process. You can be crazy and try to interpret the file, but I don't advise that. – Ismael Miguel Feb 04 '16 at 13:15

0 Answers0