soundcheck.pl 632 B

1234567891011121314151617181920
  1. #!/usr/bin/perl
  2. $block = "";
  3. $dir= '.';
  4. opendir DIR, $dir or die "Can't open directory $dir: $!\n";
  5. while ($subdir= readdir DIR) {
  6. $dirtoget = "/var/www/html/Chinese/Language/$subdir";
  7. if (opendir(SUBDIR, $dirtoget)){
  8. while($subfile = readdir SUBDIR ){
  9. if ($subdir ne "Picture" && $subdir ne "." && $subdir ne ".." && $subfile ne "." && $subfile ne ".."){
  10. $block .= $subdir . " " . $subfile . " " . $subdir . "/" . $subfile ."\n";}
  11. }
  12. closedir(SUBDIR);
  13. }
  14. }
  15. closedir(DIR);
  16. open(DAT,">/var/www/html/php/checksound/sounddir.txt") || die("Cannot Open File");
  17. print DAT $block;
  18. close(DAT);