Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: Need perl/shell/php script: PostgreSQL Media


  • From: "David E. Wheeler" <david(at)kineticode(dot)com>
  • To: Josh Berkus <josh(at)agliodbs(dot)com>
  • Cc: PostgreSQL www <pgsql-www(at)postgresql(dot)org>
  • Subject: Re: Need perl/shell/php script: PostgreSQL Media
  • Date: Fri, 31 Jul 2009 15:47:49 -0700
  • Message-id: <671DEDCC-0458-42D9-8CC0-CB8E1ACA262C@kineticode.com> <text/plain>

On Jul 31, 2009, at 12:20 PM, Josh Berkus wrote:

We could use a script which goes through a specified subdirectory tree for media.postgresql.org and produces a wiki page with:

filename  filesize   format

This will greatly aid us in getting videos where people can see them.

#!/usr/bin/perl -w

use strict;
use warnings;
use File::Find;
use MIME::Types;

my $types = MIME::Types->new;
sub file_info {
    print $File::Find::name, "\t",
          -s, "\t",
          $types->mimeTypeOf($_) || 'application/octet-stream', $/
        if -f;
}

find \&file_info, @ARGV;

Best,

David



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group