Project

General

Profile

This project is closed and read-only.

Actions

Backport #2267

closed

IO#sync = true causes offset to not be updated after writing on OS X/FreeBSD

Backport #2267: IO#sync = true causes offset to not be updated after writing on OS X/FreeBSD

Added by normalperson (Eric Wong) almost 17 years ago. Updated over 15 years ago.


Description

=begin
#!/usr/bin/env ruby

f = File.open("bar", File::RDWR|File::CREAT, 0600)
f.sync=true
f.read
f.write "Hello"
puts "Should be 5: #{f.pos}"
f.close
rm bar

from http://gist.github.com/216703

The output under FreeBSD (7.2) and OS X with both

Ruby 1.8.7 p160 and 1.8.7 p72 is:

Should be 5: 0

ref: http://thread.gmane.org/gmane.comp.lang.ruby.unicorn.general/100

=end

Actions

Also available in: PDF Atom