From: ts Date: 2003-11-20T18:50:20+09:00 Subject: Re: [BUG] File#rewind, File#syswrite, File#pos on Cygwin build >>>>> "R" == Robert Klemme writes: R> "Do not mix with other methods that write to ios or you may get R> unpredictable results." R> http://www.rubycentral.com/book/ref_c_io.html#IO.syswrite No, no. moulon% cat b.rb #!/usr/bin/ruby testStr = "hello\nthis is some example text\nblah blah blah" File.open("out.txt", 'r+') do |file| file.readlines puts "Now at position #{file.pos}" file.rewind puts "Now at position #{file.pos}" bytes = file.syswrite(testStr) puts "#{bytes} bytes written" puts "Now at position #{file.pos}" end moulon% moulon% ruby -v b.rb ruby 1.8.0 (2003-08-04) [sparc-solaris2.7] Now at position 3330 Now at position 0 46 bytes written Now at position 46 moulon% the problem is in cygwin and linux ... Guy Decoux