AsyncWgetFileGetter: create files with wallclock timestamp
authorChristian Garbs <mitch@cgarbs.de>
Wed, 2 Jun 2010 21:01:27 +0000 (23:01 +0200)
committerRalf Ertzinger <ralf@skytale.net>
Mon, 7 Jun 2010 20:45:56 +0000 (22:45 +0200)
otherwise newest downloads can't be retrieved via `ls -lrt`

videosite/AsyncWgetFileGetter.pm

index ce68046..9f330c6 100644 (file)
@@ -54,7 +54,7 @@ sub get {
     my (undef, $tmpfile) = tempfile('videosite.tmp.XXXXXXXXXXXX', DIR => $dirname);
 
     $cookie = "--header=\"Cookie: $video->{'COOKIE'}\"" if (defined $video->{'COOKIE'});
-    my $cmdline = "( wget -q -O\"$tmpfile\" $cookie \"$video->{'DLURL'}\" && mv \"$tmpfile\" \"$dlfile\" && chmod =rw \"$dlfile\" || rm -f \"$tmpfile\" ) &";
+    my $cmdline = "( wget -q -O\"$tmpfile\" $cookie \"$video->{'DLURL'}\" && mv \"$tmpfile\" \"$dlfile\" && chmod =rw \"$dlfile\" && touch \"$dlfile\" || rm -f \"$tmpfile\" ) &";
     $self->debug(encode_base64($cmdline));
     system($cmdline);