From: Tony Smith Date: 2002-01-21T23:15:25+09:00 Subject: Re: [RCR] #59 Add fsync method to IO class Matt Armstrong wrote: > matz@ruby-lang.org (Yukihiro Matsumoto) writes: > >> We have to make up consensus about fdatasync. Choose one: >> >> (1) fsync and fdatasync; NOP if not exist >> (2) fsync and fdatasync; error if not exist >> (3) fsync only; NOP if not exist >> (4) fsync only; error if not exist >> (5) we don't need both >> >> I won't vote for 5; maybe I'm going to vote for 4. > > I vote 4 (2 is my second choice). Why? > > ...fsync is widely available, fdatasync is not as common. > > ...performance difference between fsync and fdatasync is probably > not important for Ruby scripts. > > ...applications that use fsync consider it important and want to > know when it does not exist on the platform. I agree. > Are we agreed that the implementation of File#fsync will flush all > data to the OS (like File#flush) before calling fsync()? Yes. I can't see why anyone would want to do a fsync() without a flush(), so it might as well happen in one call. Also it conforms with the principle of least suprise. Tony -- Tony Smith tony at perforce dot com