|
I'm stuck tyring to do a
small program that ftp the contents of a
directory. I'm trying to use Net::FTP::Recursive on a Win XP machien. It logs in, but doesn't send the files because I'm not sure what to put in your &yoursub and CommandDir areas. From the man pages.... rput ( [ParseSub => \&yoursub] [,DirCommand => $cmd] [,FlattenTree => 1] [,RemoveLocalFiles => 1]) The recursive put method call. This will recursively send the local current working directory and its contents to the ftp object's current working directory. This method will take an optional set of arguments to tell it what the local directory listing command will be. By default, this is ``ls -al''. If you change the behavior through this argument, you probably also need to provide a ParseSub, as described above. my code.... ====================== #!/usr/bin/perl -w use Net::FTP; use Net::FTP::Recursive; my $home = "c:\\test"; my $server = "[my host]"; my $username = "{my username]"; my $password = "[my paasword]"; chdir($home) || die "cannot cd to $home ($!)"; $ftp = Net::FTP::Recursive->new("$server", Timeout => 30, Debug => 1) or die "Cannot [EMAIL PROTECTED]"; print "OK\n"; $ftp->login($username, $password) or die "Login Not Accepted..... \n"; $ftp->binary(); $ftp->cwd('docs/lail'); $ftp->rput(ParseSub => \&yoursub,DirCommand => $cmd,FlattenTree => 1); $ftp->quit; =============== If I leave out DirCommand part, I get... 'ls' is not recognized as an internal or external command, operable program or batch file. Undefined subroutine &main::yoursub called at C:/Perl/site/lib/Net/FTP/Recursive .pm line 391. I tried DireCommand = > `dir` ... and got... 'Volume' is not recognized as an internal or external command, operable program or batch file. =================== I'm not hung up on using Net::FTP::Recursive... so if you can point to something that works to send the contents of a the local file directory to a remote server, I'd appreciate it. The only ohter thing I haven't tackled is that I really only want to send files that end in "*.jpg" ... the folder should only have those, but it would be a nice filter. -- jack lail |
_______________________________________________ Perl-Win32-Users mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
