E
elbart0
Hi,
I am having problem with the 'net/ftp' library (ruby 1.8.2 (2004-08-24)
[i386-linux]).
If I make a simple call to FTP#mtime method, the following error occurs:
/usr/lib/ruby/1.8/net/ftp.rb:700:in `mtime': private method `scan' called for
nil:NilClass (NoMethodError)
which means that FTP#mdtm method returns nil.
In fact, only the very first call to FTP#mdtm returns nil!
The following script should reproduce the error :
require 'net/ftp'
$, = ' '
$\ = "\n"
Net::FTP.open('ftp.ruby-lang.org') do |ftp|
ftp.login
ftp.chdir('pub/ruby/stable')
ftp.list('*') do |line|
# p line
if line =~ /^[-d]/
fileName = line.split[-1]
isFile = line[0] == ?-
print 'entry:', fileName, isFile ? 'is a file' : 'is a directory'
if isFile
# print 'mdtm:', ftp.mdtm(fileName) # <-- if commented, fails
print 'mtime:', ftp.mtime(fileName)
end
end
end
end
I guess it's not related to 'net/ftp' library!
But could you confirm?
Best Regards,
Bart.
I am having problem with the 'net/ftp' library (ruby 1.8.2 (2004-08-24)
[i386-linux]).
If I make a simple call to FTP#mtime method, the following error occurs:
/usr/lib/ruby/1.8/net/ftp.rb:700:in `mtime': private method `scan' called for
nil:NilClass (NoMethodError)
which means that FTP#mdtm method returns nil.
In fact, only the very first call to FTP#mdtm returns nil!
The following script should reproduce the error :
require 'net/ftp'
$, = ' '
$\ = "\n"
Net::FTP.open('ftp.ruby-lang.org') do |ftp|
ftp.login
ftp.chdir('pub/ruby/stable')
ftp.list('*') do |line|
# p line
if line =~ /^[-d]/
fileName = line.split[-1]
isFile = line[0] == ?-
print 'entry:', fileName, isFile ? 'is a file' : 'is a directory'
if isFile
# print 'mdtm:', ftp.mdtm(fileName) # <-- if commented, fails
print 'mtime:', ftp.mtime(fileName)
end
end
end
end
I guess it's not related to 'net/ftp' library!
But could you confirm?
Best Regards,
Bart.