Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Net::FTP pwd bug?

by mikeock (Hermit)
on Oct 12, 2005 at 19:05 UTC ( #499647=note: print w/ replies, xml ) Need Help??


in reply to Net::FTP Error Handling
in thread Net::FTP

When using this module. I cannot get the pwd command to work.

I am connected to an ftp server and am trying to use $ftp->pwd() and I get nothing in return. Is this dumping to a default variable that I am missing or is this really a bug?


Comment on Re: Net::FTP pwd bug?
Download Code
Re^2: Net::FTP pwd bug?
by marto (Bishop) on Oct 12, 2005 at 22:30 UTC
    Hi,

    If you are following the above code try something like :
    #!/usr/bin/perl use Net::FTP; my $destserv="ftp.myhost.com"; my $destuser="username"; my $destpass="password"; $ftp = Net::FTP->new($destserv) or die "error connecting\n"; $ftp->login($destuser,$destpass); my $mypath = $ftp->pwd(); $ftp->quit(); print "FTP Path: $mypath";
    Keep in mind that this is untested, its late and I am seriously sleep deprived.
    Have you checked out the documentation? There is a link to examples you can also have a look at.

    Hope this helps

    Martin

      When that variable is added  my $mypath = $ftp->pwd(): to my code, I get the same results as just trying to call  $ftp->pwd();

      And by the same I mean that there is no repsonse at all. The Box that has the server on it allows me to login and type pwd so I know that it is supported on the server.

        Have you tried trapping for errors similar to the code in grantm's post above?:
        my $path = $ftp->pwd() or die "pwd failed: " . $ftp->code() . ": " . $ftp->message(); print "$path\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://499647]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2015-07-05 14:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (67 votes), past polls