From: Run Paint Run Run Date: 2010-03-06T12:01:40+09:00 Subject: [ruby-core:28528] Re: [Feature #1081] add File::write() convenience method Teamwork. :-) The only other inconsistency I found is how offsets are handled for non-existent paths. >> File.delete('/tmp/offset') #=> 1 >> File.binwrite('/tmp/offset','string',2) Errno::ENOENT: No such file or directory - /tmp/offset from (irb):6:in `binwrite' from (irb):6 from /usr/local/bin/irb:12:in `
' >> File.write('/tmp/offset','string',2) #=> 6 >> File.read('/tmp/offset') #=> "\u0000\u0000string" >> File.delete('/tmp/offset') #=> 1 >> File.binwrite('/tmp/offset','string',-2) Errno::ENOENT: No such file or directory - /tmp/offset from (irb):14:in `binwrite' from (irb):14 from /usr/local/bin/irb:12:in `
' >> File.write('/tmp/offset','string',-2) Errno::EINVAL: Invalid argument - /tmp/offset from (irb):16:in `write' from (irb):16 from /usr/local/bin/irb:12:in `
'