From: Paul Brannan Date: 2002-02-27T00:42:14+09:00 Subject: Re: Trouble with opening files On Wed, Feb 27, 2002 at 12:32:11AM +0900, Chris Gehlker wrote: > I just can't wrap my head around why this little program doesn't work: > > #!/usr/bin/env ruby > $stdout.sync= true > File.open("~/ruby/sample/testFile", "r") You want: File.open(File.expand_path('~/ruby/sample/testFile', 'r') do |testFile| a = testFile.gets puts a end Paul