From: Alan Davies Date: 2003-11-19T02:12:17+09:00 Subject: [BUG] File#rewind, File#syswrite, File#pos on Cygwin build On the cygwin build of ruby v1.8.0, I have encountered a strange bug when using rewind, syswrite and pos. If you open a file in read/write mode, read the contents, rewind, syswrite some data, then File#pos always seems to return zero. This does not happen if you use the windows build, or you replace 'syswrite' with 'write'. e.g: $ cat syswrite.rb #!/bin/ruby testStr = "hello\nthis is some example text\nblah blah blah" # read it, rewind, then write it back again File.open("out.txt", 'r+') do |file| file.readlines file.rewind bytes = file.syswrite(testStr) puts "#{bytes} bytes written" puts "Now at position #{file.pos}" end $ ls > out.txt $ syswrite.rb 46 bytes written Now at position 0