When doing Net::FTP.list command, I get an IOError exception after the last line of the list has been processed. Occurs under jirb or jruby
frag.rb:
require 'net/ftp'
ftp = Net::FTP.open('ftpmvs','uid','pw')
ftp.debug_mode = true
ftp.list() {|line| p line}
ftp.close
jirb transcript:
d:\Documents and Settings\mi01txp\My Documents>%JRUBY_HOME%\bin\jirb
irb(main):001:0> require 'frag'
put: TYPE A
get: 200 Representation type is Ascii NonPrint
put: PORT 10,67,54,109,7,51
get: 200 Port request OK.
put: LIST
get: 125 List started OK
"Volume Unit Referred Ext Used Recfm Lrecl BlkSz Dsorg Dsname"
"USER20 3390 2007/05/30 1 4 FB 80 3120 PO ISPF.ISPPROF"
"Migrated LIB.JCL"
"Migrated LIB.PRINT"
"Migrated LIB.SCRIPT"
"Migrated SECURE.FTP"
"USER29 3390 2007/05/31 1 1 VA 125 129 PS SPFLOG1.LIST"
IOError: No message available
from D:/jruby/lib/ruby/1.8/net/ftp.rb:625:in `loop'
from D:/jruby/lib/ruby/1.8/net/ftp.rb:431:in `retrlines'
from D:/jruby/lib/ruby/1.8/net/ftp.rb:625:in `mon_synchronize'
from D:/jruby/lib/ruby/1.8/net/ftp.rb:434:in `retrlines'
from D:/jruby/lib/ruby/1.8/net/ftp.rb:625:in `list'
from ./frag.rb:4
from (irb):1:in `require'
from (irb):1:in `binding'
from D:/jruby/lib/ruby/1.8/irb.rb:150:in `eval_input'
from D:/jruby/lib/ruby/1.8/irb.rb:70:in `signal_status'
from D:/jruby/lib/ruby/1.8/irb.rb:189:in `eval_input'
from D:/jruby/lib/ruby/1.8/irb.rb:70:in `each_top_level_statement'
from D:/jruby/lib/ruby/1.8/irb.rb:190:in `loop'
from D:/jruby/lib/ruby/1.8/irb.rb:190:in `catch'
from D:/jruby/lib/ruby/1.8/irb.rb:190:in `eval_input'
from D:/jruby/lib/ruby/1.8/irb.rb:70:in `start'
from :-1:in `catch'
from D:/jruby/lib/ruby/1.8/irb.rb:71:in `start'
from :-1irb(main):002:0>
output from running under jruby witn -d flag:
d:\Documents and Settings\mi01txp\My Documents>%JRUBY_HOME%\bin\jruby -d frag.rb
put: TYPE A
get: 200 Representation type is Ascii NonPrint
put: PORT 10,67,54,109,5,6
get: 200 Port request OK.
put: LIST
get: 125 List started OK
"Volume Unit Referred Ext Used Recfm Lrecl BlkSz Dsorg Dsname"
"USER20 3390 2007/05/30 1 4 FB 80 3120 PO ISPF.ISPPROF"
"Migrated LIB.JCL"
"Migrated LIB.PRINT"
"Migrated LIB.SCRIPT"
"Migrated SECURE.FTP"
"USER29 3390 2007/05/31 1 1 VA 125 129 PS SPFLOG1.LIST"
D:/jruby/lib/ruby/1.8/net/ftp.rb:625:in `loop': No message available (IOError)
from D:/jruby/lib/ruby/1.8/net/ftp.rb:431:in `retrlines'
from D:/jruby/lib/ruby/1.8/net/ftp.rb:625:in `mon_synchronize'
from D:/jruby/lib/ruby/1.8/net/ftp.rb:434:in `retrlines'
from D:/jruby/lib/ruby/1.8/net/ftp.rb:625:in `list'
from frag.rb:4
Outpur from running under ruby:
d:\Documents and Settings\mi01txp\My Documents>ruby frag.rb
put: TYPE A
get: 200 Representation type is Ascii NonPrint
put: PORT 10,67,54,109,5,10
get: 200 Port request OK.
put: LIST
get: 125 List started OK
"Volume Unit Referred Ext Used Recfm Lrecl BlkSz Dsorg Dsname"
"USER20 3390 2007/05/30 1 4 FB 80 3120 PO ISPF.ISPPROF"
"Migrated LIB.JCL"
"Migrated LIB.PRINT"
"Migrated LIB.SCRIPT"
"Migrated SECURE.FTP"
"USER29 3390 2007/05/31 1 1 VA 125 129 PS SPFLOG1.LIST"
get: 250 List completed successfully.
d:\Documents and Settings\mi01txp\My Documents>
Tom Porter