From: angus Date: 2002-06-16T23:37:27+09:00 Subject: Re: File.new('foo', 0600 , 'wb') > ># Of course you can specify arbitrary mode allowed on your system. > ># eg. File.new("/tmp/foo", File::CREAT|File::TRUNC|File::RDWR, 0600) > > > Thanks. How to write the equivalent of > > File.new "foo", "wb", 0600 > > ? > > I mean, how to specify that it's a binary (image) file? What is the difference if you are on a Unix system? In any case, if you need to open the file with "wb", you can set first File.umask, then open with File.new "foo", "wb", and then restore File.umask to the original value.