Skip to content
Browse files

die() if $fname already exists

  • Loading branch information...
1 parent fba5105 commit 6cc9926c75ef8b44cbe9da98826c751920d570e0 @olof olof committed Aug 14, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 yx.pl
View
1 yx.pl
@@ -69,6 +69,7 @@ sub get_filename {
exec("mplayer -fs '$uri'") if $opts->{stream};
my $fname = get_filename($map{$itag}, \$html);
+die("$fname already exists in .") if -e $fname;
print "Downloading to $fname\n";
exec("curl -Lo $fname '$uri'\n") if $opts->{curl};
exec("wget -O $fname '$uri'") if $opts->{wget};

0 comments on commit 6cc9926

Please sign in to comment.
Something went wrong with that request. Please try again.