From 71b4b2ffa99dc6c9da49dc4cf88436ba63e318c1 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 16 Mar 2001 13:05:18 +0000 Subject: moved to contrib/ --- perl/recursiveftpget.pl.in | 67 ---------------------------------------------- 1 file changed, 67 deletions(-) delete mode 100755 perl/recursiveftpget.pl.in (limited to 'perl/recursiveftpget.pl.in') diff --git a/perl/recursiveftpget.pl.in b/perl/recursiveftpget.pl.in deleted file mode 100755 index 7d9cf8eb8..000000000 --- a/perl/recursiveftpget.pl.in +++ /dev/null @@ -1,67 +0,0 @@ -#!@PERL@ -# -# Author: Daniel Stenberg -# Date: August 25 1998 -# Version: 0.1 -# -# This is just meant as an example of why we wrote curl in the first place. -# Quick n' easy scripting use. -# - -$dir = $ARGV[0]; - -$target = $ARGV[1]; - -$maxdepth = $ARGV[2]; - -if($dir eq "" || $target eq "") { - print "Usage: [max depth level] \n"; - print " End the URL with a slash if a directory is specified, please\n"; - exit; -} - -if(($maxdepth ne "") && ($maxdepth == 0)) { - # reached maximum depth, die - print "Reached maximum recursive depth level ($maxdepth), exiting...\n"; - exit; -} - -# get dir -@all = `curl -s $dir`; - -if($all[0] ne "") { - print "Got the main $dir dir\n"; -} - -line: -for(@all) { - chop; # cut off newline - @linep= split(" ", $_); - - $name = $linep[$#linep]; - - $firstletter=substr($linep[0], 0, 1); - - if($firstletter eq "d") { - # this is a subdir, recurse - # if not . or .. of course - - if(($name eq ".") || ($name eq "..")) { - next line; - } - print "Recursing for dir $dir$name in target $target/$name\n"; - - $nextdepth=$maxdepth-1; - print `$0 $dir$name/ $target/$name $nextdepth`; - } - elsif($firstletter eq "-") { - # this is a file, get it - # oh, make sure the target dir exists first - - if(! -r $target ) { - mkdir($target,0777); - } - print "Getting file $dir$name in target $target/$name\n"; - print `curl -s $dir$name >$target/$name`; - } -} -- cgit v1.2.3