Thank you very much! I downloaded and installed 5.8.3 from ActiveState. Now I am getting the ASCII mode transfer when I need to.
Regards, Sui -----Original Message----- From: Graham Barr [mailto:[EMAIL PROTECTED] Sent: Thursday, April 22, 2004 3:56 PM To: Sui Ming Louie Subject: Re: Net::FTP ASCII Mode There is a bug in 5.8.0 that causes problems in ascii mode. i suggest you upgrade your perl binary 5.8.4 is the latest release Graham. On 22 Apr 2004, at 20:23, Sui Ming Louie wrote: > Graham, your assistance is greatly appreciated. > > � > > I am trying to use the Net::FTP module in Perl 5.8.0 build 804 in > Windoze XP.� Even though the trace below indicates ASCII transfer > mode, the file brought from SGI workstation is still in Unix format > when I open it on my XP workstation. > > � > > I changed debug from 0 to 1 and got the following (unabridged) output: > > � > > Net::FTP: Net::FTP(2.65) > > Net::FTP:�� Exporter(5.566) > > Net::FTP:�� Net::Cmd(2.21) > > Net::FTP:�� IO::Socket::INET(1.26) > > Net::FTP:���� IO::Socket(1.27) > > Net::FTP:������ IO::Handle(1.21) > > � > > Net::FTP=GLOB(0x1a5a198)<<< 220 ted FTP server ready. > > Net::FTP=GLOB(0x1a5a198)>>> user tensyl > > Net::FTP=GLOB(0x1a5a198)<<< 331 Password required for tensyl. > > Net::FTP=GLOB(0x1a5a198)>>> PASS .... > > Net::FTP=GLOB(0x1a5a198)<<< 230 User tensyl logged in. > > Net::FTP=GLOB(0x1a5a198)>>> CWD /Tensyl/Project/Summer_Wind > > Net::FTP=GLOB(0x1a5a198)<<< 250 CWD command successful. > > Net::FTP=GLOB(0x1a5a198)>>> TYPE A > > Net::FTP=GLOB(0x1a5a198)<<< 200 Type set to A. > > Net::FTP=GLOB(0x1a5a198)>>> PORT 192,168,168,38,9,173 > > Net::FTP=GLOB(0x1a5a198)<<< 200 PORT command successful. > > Net::FTP=GLOB(0x1a5a198)>>> RETR file_464.dxf > > Net::FTP=GLOB(0x1a5a198)<<< 150 Opening ASCII mode data connection > for 'file_464.dxf' (629923 bytes). Net::FTP=GLOB(0x1a5a198)<<< 226 > Transfer complete. > > Net::FTP=GLOB(0x1a5a198)>>> QUIT > > Net::FTP=GLOB(0x1a5a198)<<< 221 Goodbye. > > � > > Abridged perl code follows: > > �use Net::FTP; > > �use Getopt::Std; > > �getopts ('a:u:p:d:th', \%opts); > > � > > �my $default_dir = "/xxxx/Project"; # changed for this posting > > � > > � # ==================== > > � # default IP address: changed for this posting > > � # ==================== > > �$opts{'a'} = "xxx.yyy.zzz.41"� if (not defined $opts{'a'}); > > � > > ��# ======================================================= > > � # append default directory if only base directory given > > � # ======================================================= > > �$opts{'d'} = $default_dir if (not defined $opts{'d'}); > > �$opts{'d'} = $default_dir . '/' . $opts{'d'} if (not ($opts{'d'} =~ > > /^\//)); > > � > > �my $ftp = Net::FTP->new ($opts{'a'}, Debug => 1; > > �$ftp->login ("tensyl", "xxxxxx"); # changed for this posting > > �$ftp->cwd ($opts{'d'}); > > � > > ��# ====================== > > � # ascii (or text) mode > > � # ====================== > > $ftp->ascii(1)� if (defined $opts{'t'}); > > my $getrv; > > while (defined $ARGV[0]) { > > �� $getrv = $ftp->get ($ARGV[0]); > > �� if (defined $getrv) { > > ���� print "$getrv\n"; > > �� } else { > > ���� print ("Error in getting file: <$default_dir/$ARGV[0]>\n"); > > �� } # if > > � > > �� shift @ARGV; > > � > > } # while > > � > > � > > Regards, > > � > > Sui Ming Louie > _______________________________________________ ActivePerl mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
