A
andrey
irb(main):001:0> f = File.new("/etc/host.conf")
=> #<File:/etc/host.conf>
irb(main):002:0> f.gets
=> "multi off\n"
irb(main):003:0> f.pos
=> 10
irb(main):004:0> f.gets
=> "order hosts,bind\n"
irb(main):005:0> f.pos
=> 27
irb(main):006:0> f.close
=> nil
All right.
irb(main):007:0> f = File.new("/etc/host.conf")
=> #<File:/etc/host.conf>
irb(main):008:0> f.sysread(5)
=> "multi"
irb(main):009:0> f.pos
=> 5
irb(main):010:0> f.sysread(10)
=> " off\norder"
irb(main):011:0> f.pos
=> 5
Bug?
% ruby1.8 --version
ruby 1.8.5 (2006-08-25) [i486-linux]
=> #<File:/etc/host.conf>
irb(main):002:0> f.gets
=> "multi off\n"
irb(main):003:0> f.pos
=> 10
irb(main):004:0> f.gets
=> "order hosts,bind\n"
irb(main):005:0> f.pos
=> 27
irb(main):006:0> f.close
=> nil
All right.
irb(main):007:0> f = File.new("/etc/host.conf")
=> #<File:/etc/host.conf>
irb(main):008:0> f.sysread(5)
=> "multi"
irb(main):009:0> f.pos
=> 5
irb(main):010:0> f.sysread(10)
=> " off\norder"
irb(main):011:0> f.pos
=> 5
Bug?
% ruby1.8 --version
ruby 1.8.5 (2006-08-25) [i486-linux]