Here's a hack I made to dump the contents of a .metadata file.
P.S., man page spelling problem: Hrdeman:
  AUTHOR
       Written by David Hrdeman <da...@hardeman.nu>

#!/usr/bin/perl
# Dump a metastore .metadata file
# Copyright       : http://www.fsf.org/copyleft/gpl.html
# Author          : Dan Jacobson http://jidanni.org/
# Created On      : 2009.01.01
# Last Modified On: Thu Jan  1 04:40:16 2009
# Update Count    : 189
# A total hack.
# Usage: $0 .metadata
use strict;
use warnings FATAL => 'all';
local $/;
$_ = <>;
s/^MeTaSt00r3// or die 'Magic header wrong';
s/^[\0]{8}//    or die 'Version different';
my $N    = "[^\0]+";
my @abbr = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec );

while (s/^($N)[\0]($N)[\0]($N)[\0](.{8}).{8}(..)//s) {
    my ( undef, $min, $hour, $mday, $mon, $year ) = localtime unpack 'i', $4;
    printf "%o $2\t$3\t%s %2i %02i:%02i %i $1\n", 0400 + ord $5,
      $abbr[$mon], $mday, $hour, $min, $year + 1900;
    s/^[\0]{4}// or die 'not ready for attributes';
}
die 'junk at end of file?' if /./;



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to