set binary mode for transfer
authorroot@py2.ccos.de
Sat, 17 Oct 2009 22:36:18 +0200
changeset 2 d9a8e1938145
parent 1 f5d804981be8
child 3 c76747e056b6
set binary mode for transfer
ftpipe
--- a/ftpipe	Sat Oct 17 22:36:10 2009 +0200
+++ b/ftpipe	Sat Oct 17 22:36:18 2009 +0200
@@ -40,6 +40,7 @@
 
     my $ftp = new FTP($ftp{host}, Debug => $opt_debug, Passive => 1);
     $ftp->login($ftp{user}, $ftp{pass});
+    $ftp->binary;
     $ftp->cwd($ftp{dir}); 
 
     given ($opt_cmd) {
@@ -92,6 +93,12 @@
     my $self = shift;
     $self->SUPER::get(@_) or die "Can't put: " . $self->message;
   }
+
+  sub binary {
+    my $self = shift;
+    $self->SUPER::binary(@_) or die "Can't set binary mode: " . $self->message;
+  }
+
 }