On Wednesday, 27 December, 2006 at 18:53:17 +0300, Odhiambo Washington wrote:
> Hiya,
> 
> I hope you had a merry Christmas ;)
> 
> I am trying to determine the time of last modification of a file,
> on FreeBSD.
> 
> The following code achieves the same on Linux:
> 
> 
> # AGE = (current time) - (time of last modification of "$FILE")
> # please check your systems 'stat' command!
> AGE=$(($(date +%s) - $(stat -c '%Y' "$FILE")))
> 
> test $AGE -lt $DELAY && {
>         echo -n yes
>         exit 0
> }

I *think* what you are looking for is:

  stat -f '%Sm' -t '%s'

There is probably a much easier way to do that, but I couldn't find it
in the five minutes I had to spare.  :-)


Cheers,
       Nick.
-- 
Please do not CC me on replies, I read the list and don't need the dupes.

_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to