Cany any one help me in solving this..
Problem statement: I have a requirement to find the time from which there are no files created in a given directory. For this I am assuming that I need to get the file creation time in seconds, then the current time in seconds using `date +%s`. Then calculating the time by subtracting file creation time from date.
Please, help me in getting the file creation time in seconds..
You may want to revisit your assumption: for performance reasons, file metadata is not always updated every time an open file is written to. Depending upon a lot of factors the directory could be stale and your test would think no file writes had occurred, when in fact they have.
The systems that I've used have a stat utility that wraps the stat syscall. If you have that, you can use it instead of perl (not that there's anything at all wrong with perl ... respect heheh ;)).
Regards,
Alister
---------- Post updated at 09:17 PM ---------- Previous update was at 09:11 PM ----------
That prompted me to take a look at the posix date man page. I'm more than a little stunned that epoch isn't a standardized format specifier. Not even a mention in the rationale. Weird.