Mongers,

I made a small script to move some animations from my home Mac to my 
virtual server.  The problem seems to be that the file name are in EUC 
(bytebyte.gif), and Net::FTP mangles the file name while writing it 
onto the server.  I was having a similar problem with Fetch.  Fetch 
mangled up some files names but not all... which is why I installed 
Net::FTP in the first place.   Any thoughts on the simplest way to 
handle this?  My suspicion is that I have to tell Perl that I have 
oddball characters in the filenames.  If this has no simple solution, I 
have this ugly feeling I may have to resort to a tar archive.  Here is 
the code I used to see if it would succeed with an upload of the first 
10 files (animated gifs) I needed to upload to my server.  The files 
are fine, but the names garbled:
- Jim

#!/usr/bin/perl -w
use Net::FTP;
use Carp;
$ftp = Net::FTP->new("my_domain.com", Debug => 0)
     or die "Cannot connect to some.host.name: $@";
$ftp->login("my_id",'my_password')
     or die "Cannot login ", $ftp->message;
$ftp->cwd("/path_to_upload_directory/")
     or die "Cannot change working directory ", $ftp->message;
$ftp->binary;
opendir (ASODS, "/Local_Animiations_Folder/") || die "where is 
Local_Animiations_Folder: $!";
@GIF89a = grep /\.gif$/, readdir ASODS;
closedir ASODS;
$count = 1;
foreach (@GIF89a) {
   chomp $_;
   print "$_\n";
   $ftp->put("/Local_Animiations_Folder/$_",$_)
       or die "put failed ", $ftp->message;
   last if $count == 10;
   $count++;
   }
$ftp->quit;

 
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to