X-Git-Url: http://git.pippins.net/embedvideo/.git/?a=blobdiff_plain;f=homevideo_random.pl;fp=homevideo_random.pl;h=4e5a81a8f05b31888845eb367478d6effe06e785;hb=be9a9d1914a8f80b031631f902c9daae0b8f6d90;hp=0000000000000000000000000000000000000000;hpb=6ab397855fde341417761a2e91667c85cbfc41ef;p=videoscripts%2F.git diff --git a/homevideo_random.pl b/homevideo_random.pl new file mode 100755 index 0000000..4e5a81a --- /dev/null +++ b/homevideo_random.pl @@ -0,0 +1,16 @@ +#!/usr/bin/perl + +use List::Util 'shuffle'; + +my $dir = "/naspool/videos/HomeVideos"; +my $plsfile = "$dir/Random.pls"; +my $avifiles = "????/????-??-??.avi"; + +chdir $dir || die "Couldn't change directory!\n"; +system "rm -f $plsfile"; +@files = `ls -1 $avifiles`; +@shuffled = shuffle(@files); +open (FILE, ">$plsfile") || die "Couldn't open $plsfile!\n"; +print FILE @shuffled; +close (FILE); +