in reply to Re: cwd of remote server using Net::FTP
in thread cwd of remote server using Net::FTP

I tried pwd(). It is returning '/'. my script is as follows.
use Net::FTP; $ftp = Net::FTP->new("Ram", Debug => 0) or die "Cannot connect to some.host.name: $@"; $ftp->login("anonymous",'-anonymous@') or die "Cannot login ", $ftp->message; $temp = $ftp->pwd(); print "test\n", $temp ; #$ftp->get("test.txt") #' or die "get failed ", $ftp->message; $ftp->quit;
Thanks & Regards

Nalina

Replies are listed 'Best First'.
Re^3: cwd of remote server using Net::FTP
by pg (Canon) on Dec 03, 2004 at 06:23 UTC

    Net::FTP behaves in the same way as your command line ftp. I bet that, if you ftp from command line to the same site, then issue a pwd command, you will get the same thing, the root.

    So this is not a problem with Net::FTP module, but rather the server is configured in this way, and that was what you supposed to get. I tried to ftp ftp.sun.com, that was what I got.

    However this is not always what you get. When I try to ftp to a UNIX node on your company's network that I have account, I was led to my home directory.