From: "David A. Black" Date: 2009-09-09T21:47:46+09:00 Subject: Re: different results with File.exists? --1926193751-1448452958-1252500446=:16133 Content-Type: MULTIPART/MIXED; BOUNDARY="1926193751-1448452958-1252500446=:16133" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1926193751-1448452958-1252500446=:16133 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8BIT Hi -- On Wed, 9 Sep 2009, Robert Klemme wrote: > 2009/9/9 David A. Black : >> Hi -- >> >> On Tue, 8 Sep 2009, Robert Klemme wrote: >> >>> 2009/9/8 Mehdi Karamnejad : >>>> >>>> yeah,that was it! thanks ;) >>> >>> Additional hint: use p to debug output what you have. e.g. >>> >>> path=gets >>> p path >>> if File.exists?(path) then >> >> Meta-additional hint: in 1.9, p returns its argument(s), so if you >> have: >> >> �path = gets >> >> you can just change it to: >> >> �p path = gets >> >> which makes for slightly easier back-and-forth between the p version >> and the non-p version. > > David, did you rather mean "path = p gets"? Because "p path = gets" > does work in pre 1.9 already. :-) I didn't really mean path = p gets -- I was thinking in general of the idiom of: p x instead of p x x but chose a bad example :-) David -- David A. Black / Ruby Power and Light, LLC / http://www.rubypal.com Ruby/Rails training, mentoring, consulting, code-review Latest book: The Well-Grounded Rubyist (http://www.manning.com/black2) September Ruby training in NJ has been POSTPONED. Details to follow. --1926193751-1448452958-1252500446=:16133-- --1926193751-1448452958-1252500446=:16133--