Skip to content

Instantly share code, notes, and snippets.

Created October 4, 2010 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/609592 to your computer and use it in GitHub Desktop.
Save anonymous/609592 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
$| = 1;
while (<>) {
chomp();
if( ! -f "/var/www/mediacas/$_" ){
print "$_\n";
}else{
open(KEYFILE, "/var/www/mediacas/$_") || die "cannot open file for reading @!";
my $line=<KEYFILE>;
close(KEYFILE);
if($line=~m/^([0-9a-f]+)/){
print "hashes/$1\n";
}else{
#s|^.*|mediacas/incoming/test/test2.jpg|;
print "$_\n";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment