From: Carlos Date: 2002-06-17T05:45:31+09:00 Subject: Re: File.new('foo', 0600 , 'wb') > > flag |= File::BINARY if File::Constants.const_defined?("BINARY") > > > > with 1.7 > > > > flag |= File::BINARY if File::const_defined?("BINARY") > > > Thx. > > With 1.7.2, is > File.new "foo", "wb", 0600 > OK? Sorry I get in the way again :). I don't know about 1.7, but in 1.6 (and I don't think the interface has changed), you have 2 options to open a file: File.new , and File.new , , So you cannot specify permissions if you use "wb", this parameter is ignored. If you want to specify permissions, you must use numeric mode. Guy is suggesting that you do: flag = File::CREAT flag |= File::BINARY if File::Constants.const_defined?("BINARY") File.new "foo", flag, 0600