From: "Jean-François Boisvieux" Date: 2006-03-27T01:58:11+09:00 Subject: Re: File.new raise an exception ? Thanks Patrick for this precise and clear answer Jean-Francois Le 26 mars 06 � 18:38, Patrick Hof a �crit : > Jean-Fran�ois Boisvieux schrieb: > > >> irb(main):001:0> foo = File.open("test") >> Errno::ENOENT: No such file or directory - test >> from (irb):1:in `initialize' >> from (irb):1:in `open' >> from (irb):1 >> >> I just do not understand the problem ( I can create a file with >> python in the same directory ), what's wrong for me ? >> > > Ruby is opening the file for reading per default. As there seems to be > no file with the name test, you get the error. To open it for writing, > you have to say > > File.open("test", "w") > > Patrick > > -- > "Ah. Philosophy," said Om. > (Small Gods) >