From: "Peña, Botp" Date: 2007-01-27T17:17:11+09:00 Subject: Re: prob with File.open and perms pls ignore my post below. it's terrible. i should have deleted the outputted file before running the program again. nobu's post is the_ answer. In this regard, may i suggest a feature for documenting methods from File.new(filename [, mode [, perm]]) => file to File.new(filename => String [, mode = File::WRONLY => Integer in File IO [, perm = 0644 => Integer in octal form]] ) => file in IO or something like that. A quick glance, we'd know more about the parameters.. sorry for the noise, kind regards -botp # -----Original Message----- # From: Pe�a, Botp [mailto:botp@delmonte-phil.com] # Sent: Saturday, January 27, 2007 3:14 PM # To: ruby-talk ML # Subject: Re: prob with File.open and perms # # From: Une B�vue [mailto:unbewusst.sein@google.com.invalid] # # i get the following perms : # # --w----r-- # # # # Hi Une, # # it works for me. # # #---------- # root@pc4all:~# cat test3.rb # File.open('a_file',File::WRONLY|File::TRUNC|File::CREAT,644) do |f| # f.print 'something else' # end # root@pc4all:~# ruby test3.rb # # root@pc4all:~# ll a_file # -rw-r--r-- 1 root root 14 Jan 27 15:07 a_file # # root@pc4all:~# ruby -v; uname -an # ruby 1.8.5 (2006-12-21 patchlevel 5000) [i686-linux] # Linux pc4all 2.6.15-27-686 #1 SMP PREEMPT Fri Dec 8 18:00:07 # UTC 2006 i686 GNU/Linux # #---------- # # kind regards -botp # # # # #