#!/usr/bin/perl

use Net::FTP;

my $ftp = Net::FTP->new("ftp.bz2.us.kernel.org", Debug => 0);
if (!$ftp) {print stderr "Connect failed: '$@'\n"; next}
if (!$ftp->login) {print stderr "Login failed: '$@'\n"; next}
if (!$ftp->cwd("/pub/linux/kernel/v2.4"))  {
	if ($dir =~ /^(.*)\/([^\/]+)$/) {
		$dir=$1; $file=$2;
		if (!$ftp->cwd($dir))  {
			print stderr "No such dir: '$dir'\n"; next
		}
	} else {
		print stderr "No such dir: '$dir'\n"; next
	}
}
print $ftp->dir;
