Padre

 view release on metacpan or  search on metacpan

t/94_padre_file_remote.t  view on Meta::CPAN

$file = Padre::File->new('ftp://ftp.kernel.org/welcome.msg');
ok( defined($file), 'FTP2: Create Padre::File object' );
cmp_ok( $file->size, '>', 0, 'FTP2: file size' );
is( $file->servername, 'ftp.kernel.org',       'FTP2: servername' );
is( $file->dirname,    'ftp://ftp.kernel.org', 'FTP2: servername' );
is( $file->basename,   'welcome.msg',          'FTP2: servername' );
ok( $file->exists, 'FTP2: Exists' );

# Test some FTP servers
foreach my $url (
	'ftp://ftp.ubuntu.com/ubuntu/project/ubuntu-archive-keyring.gpg',
	'ftp://ftp.proftpd.org/README.MIRRORS',                        # Proftpd
	'ftp://ftp.redhat.com/pub/redhat/linux/README',                # vsftpd
	'ftp://ftp.cisco.com/test.html',                               # Apache FTP
	'ftp://ftp.gwdg.de/pub/mozilla.org/_please_use_ftp5.gwdg.de_', # Empty file

	# TODO: Find a public FTP server using Microsoft FTP service and add it
	)
{
	$url =~ /ftp\:\/\/(.+?)\// and my $server = $1;
	$file = Padre::File->new($url);



( run in 1.461 second using v1.01-cache-2.11-cpan-df04353d9ac )