From: KOSAKI Motohiro Date: 2010-12-16T22:04:44+09:00 Subject: [ruby-core:33750] Re: [Ruby 1.9-Feature#4015] File::DIRECT Constant for O_DIRECT 2010/12/16 Yukihiro Matsumoto : > Hi, > > If you consider O_DIRECT is common across platforms, I'd agree with > merging it. Yeah, at least following platforms support it. o Linux o FreeBSD o NetBSD o AIX Unfortunatelly, Solaris and MacOS have similar but different function. They support to turn direct-io on/off after open. However I haven't seen such dynamically turning-on requirement. o Solaris -> directio() o Mac -> fcntl(F_NOCACHE) So, we have two option, I think. o Implement O_DIRECT emulation. Easy. Only problem is how do we define O_DIRECT number. (iow How do we know unused open flag bit on their platform) o Enhance ruby open method. Adding options hash argument at last of open. :directio=>true turn directio feature on. It seems slightly overengineering. but options hash can be used other ways. (Namely platform dependent open option support e.g. windows have some platform specific open flag for performance) Which do you prefer? Thanks.