Anti-nuisance lawsuit warning: The purpose of these notes is to remind me, Zoegond, of stuff or to help me work stuff out. They may contain mistakes.

Quick

  • ($a, $b....) = unpack("A2A7...", $packed)
  • push( array, list )

Wednesday, February 10, 2010

Perl file times

The conversion from file operator times to epoch times is

$^T - ((-M $file) * 86400)

(the result of -M has to be converted from days to seconds, then subtracted from Perl start time)

Consequently the current age of a file in seconds is

(-M $file) * 86400

That may seem obvious but I've got it the wrong way round more times than I care to remember.

Followers

Blog Archive