LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-17-2006, 03:29 PM   #1
innuendo_98
LQ Newbie
 
Registered: Mar 2005
Location: USA
Distribution: Mandrake
Posts: 19

Rep: Reputation: 0
Exclamation net::ftp


Anyone experienced with Net::Ftp ??

I'm trying to do a transfer, but there seems to be a problem in the $ftp->cwd();.

1. $ftp->ls() doesn't see the symbolic links, when using $ftp->dir() symbolic links will be shown.

Pretty much what I' trying to do is this, once I connect and change my directory in the ftp i gotta check if the directory where I want to transfer is a regular directory or a symbolic lynk. If its a symbolic link, I should just follow it and do the transfer.

Code:
$ftp = Net::FTP::Recursive->new($config{'host'}, isSymlink => 1, Debug => 1);
$ftp->login( $config{'user'}, $config{'pass'});
$ftp->cwd( $config{'trgt'});
my @listClients = $ftp->ls();
foreach $x (@listClients){
if (-l $x){
        print "Inside link test ".$x."\n";
        if (defined($clientLink = readlink($ftp->pwd()."/".$x))) {
                print "\t\t".$clientLink."\n";
                $ftp-> cwd( $clientLink );
                print $ftp->pwd();
        }
} else {
        $ftp->cwd( $client );
        }
}
$ftp->binary();                                         #Set Binary mode
$ftp->rput();
$ftp->quit;
Thanks in advance for any help.
 
Old 07-18-2006, 11:17 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
You might try these guys if you don't get an answer soon: http://www.perlmonks.com/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
backing up to the net with ftp or rsync rblampain Linux - General 2 04-27-2006 12:40 AM
ftp.nerim.net repository Artik Debian 1 06-26-2005 04:42 AM
Urgent Help: Perl FTP Script Using NET::FTP xboxter Programming 8 05-16-2005 06:57 PM
perl and Net::FTP question Tomasfuego Programming 0 12-17-2003 08:13 AM
RH 7.3 Net install? FTP or HTTP? Ůmegaflops Linux - Newbie 4 05-27-2002 01:06 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration