Net::FTP: cwd(' ')



Hi,

I have this problem:

I'd like to access a directory named ' ' (a single blank) on an ftp server.
I can connect all right, but the $ftp->cwd(' '), while succeeding, only moves me to /, rather than into the directory.
I've also tried '" "' and '\ ' to no avail.


#!/usr/bin/perl
use Net::FTP;

my $host = 'X.Y.Z';
my $username = 'anonymous';
my $password = 'anonymous';

my $dir = ' ';

$ftp=Net::FTP->new($host,Timeout=>240) or die "Cannot connect";
print "Connected\n";

$ftp->login($username, $password) or die "Cannot login";
print "Logged in\n";

$ftp->cwd($dir) or die "Cannot chdir to blank";
print "Now in ", $ftp->pwd, "\n";

my @files = $ftp->ls or die "Cannot get file list";
foreach (@files) {
    print ">$_<\n";
}
$ftp->quit;

--
Josef Möllers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize
						-- T.  Pratchett

.



Relevant Pages

  • pushing csv vaules into hash
    ... I need to split values from a csv value and push ... then perform a routine for all of them in a foreach ... address with the message containing their username and password. ... through them with once they are in the array, but then how do I get them ...
    (perl.beginners)
  • Re: pushing csv vaules into hash
    ... then perform a routine for all of them in a foreach ... address with the message containing their username and password. ... successful in reading the lines of the file and the ability to iterate ... through them with once they are in the array, but then how do I get them ...
    (perl.beginners)
  • Re: pushing csv vaules into hash
    ... pushing csv vaules into hash ... then perform a routine for all of them in a foreach ... address with the message containing their username and password. ... through them with once they are in the array, but then how do I get them ...
    (perl.beginners)
  • Re: PWDUMP Parser
    ... I need to extract ... A quick Perl script would do it for you...the below script takes a username as an arguement and dumps the username/hash pair to a file. ... foreach my $line { ...
    (Pen-Test)