home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / perl_ste.zip / auto / Net / FTP / pasv_wait.al < prev    next >
Text File  |  1997-11-28  |  579b  |  30 lines

  1. # NOTE: Derived from ./blib/lib/Net/FTP.pm.  Changes made here will be lost.
  2. package Net::FTP;
  3.  
  4. sub pasv_wait
  5. {
  6.  @_ == 2 or croak 'usage: $ftp->pasv_wait(NON_PASV_FTP)';
  7.  
  8.  my($ftp, $non_pasv) = @_;
  9.  my($file,$rin,$rout);
  10.  
  11.  vec($rin,fileno($ftp),1) = 1;
  12.  select($rout=$rin, undef, undef, undef);
  13.  
  14.  $ftp->response();
  15.  $non_pasv->response();
  16.  
  17.  return undef
  18.     unless $ftp->ok() && $non_pasv->ok();
  19.  
  20.  return $1
  21.     if $ftp->message =~ /unique file name:\s*(\S*)\s*\)/;
  22.  
  23.  return $1
  24.     if $non_pasv->message =~ /unique file name:\s*(\S*)\s*\)/;
  25.  
  26.  return 1;
  27. }
  28.  
  29. 1;
  30.