All pastes #416024 Raw Edit

Someone

public text v1 · immutable
#416024 ·published 2007-03-30 00:40 UTC
rendered paste body
#!/usr/bin/perl

use strict;
use File::Find;

my @dirs;
my @files;

sub is_readable($) {
  my $fname = $File::Find::name;
  if ( -d $fname ) {
    push @dirs, $fname if ((stat(_))[2] & 0005);
  } elsif ( -f _ ) {
    if ((stat(_))[2] & 0004) {
      for my $dir (@dirs) {
        if ($File::Find::dir eq $dir) {
          push @files, $fname;
          last;
        }
      }
    }
  }
}

find(\&is_readable,  '/');

for (@files) {
  print "$_\n";
}