From: ts Date: 2003-11-19T02:58:55+09:00 Subject: Re: [BUG] File#rewind, File#syswrite, File#pos on Cygwin build >>>>> "A" == Alan Davies writes: A> On the cygwin build of ruby v1.8.0, I have encountered a strange bug A> when using rewind, syswrite and pos. If you open a file in read/write A> mode, read the contents, rewind, syswrite some data, then File#pos A> always seems to return zero. This does not happen if you use the A> windows build, or you replace 'syswrite' with 'write'. try to add a flush A> File.open("out.txt", 'r+') do |file| A> file.readlines A> file.rewind A> bytes = file.syswrite(testStr) file.flush A> puts "#{bytes} bytes written" A> puts "Now at position #{file.pos}" A> end Guy Decoux