]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/interface/mywget
Now mywget is used instead of wget. mywget is a wrapper for wget
[helm.git] / helm / interface / mywget
diff --git a/helm/interface/mywget b/helm/interface/mywget
new file mode 100755 (executable)
index 0000000..c6f3205
--- /dev/null
@@ -0,0 +1,19 @@
+#!/usr/bin/perl
+
+if ($#ARGV != 1) {
+ print STDERR "Usage: mywget prefix URL\n";
+ exit -1;
+}
+
+my ($prefix,$URL) = @ARGV;
+if ($URL =~ /^file:\//) {
+ $URL =~ s/^file:\///;
+ my $command = "mkdir -p $prefix ; cp $URL $prefix";
+ print "$command\n";
+ system($command) == 0
+  or die "\"$command\" error";
+} else {
+ my $command = "wget -c -P $prefix $URL";
+ system($command) == 0
+  or die "\"$command\" error";
+}