From: Yukihiro Matsumoto Date: 2009-02-02T15:27:47+09:00 Subject: [ruby-core:21732] Re: [Feature #1081] add File::write() convenience method Hi, In message "Re: [ruby-core:21701] [Feature #1081] add File::write() convenience method" on Sun, 1 Feb 2009 05:46:57 +0900, Suraj Kurapati writes: |Please add a File::write() convenience method to the core Ruby API. | |Currently, it is easier to read whole files than to write them: | | # reading a whole file --- less effort | text = File::read('foo.txt') | | # writing a whole file --- more effort | File::open('foo.txt', 'wb') {|f| f.write 'ruby!' } open() has following API open(path, mode="r", mode=0, opthash=nil) write() has IO#write(string) What do you think proper API for combined File.open? File::write(path, string, mode, opt) or File::write(string, path, mode, opt) or whatever? The latter would conflict with some in-house definition of File::write. matz.