#!perl # Chris Uriarte #Searches for directories under $basedir that don't have m3u playlists $basedir = $ARGV[0] || die "useage: noplaylist.pl \n"; chdir($basedir) || die "Could not chdir to $basedir. Is it a valid path?\n"; $number = 0; print "Scanning for directories that are missing m3u playlists...\n"; print "Getting list of artist directories\n"; @dirs = <*>; foreach (@dirs) { my $artist_dir = $_; my $artist_path = $basedir . '\\' . $artist_dir; chomp($artist_path); #print "Found artist $artist_dir\n"; #Now go into the artist directory; chdir($artist_path); my @albums_dir = <*>; foreach (@albums_dir) { my $album_dir = $_; chdir($artist_path); chdir($album_dir) || die "can't chdir to $album_dir\n"; chomp($album_dir); #Get the m3us @m3us = <*.m3u>; #print "Found @m3us playlists ($total found total)\n"; if (@m3us == "") { print "$artist_dir - $album_dir has no playlist!\n"; $number++; } else { $number++; } chdir("..") } #end of album loop for this artist } #end artist directories loop print "Search completed.\n"; print "Scanned $number m3us\n";