Project

General

Profile

Actions

Backport #2267

closed

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

Added by normalperson (Eric Wong) over 14 years ago. Updated about 13 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: Atom PDF

Like0
Like0Like0Like0