I'm no Ruby programmer, but don't you need a call to system() instead of the backtick operator here? Appears that the backtick operator returns STDOUT instead of the return value:
http://hans.fugal.net/blog/2007/11/03/backticks-2-0 Norbert On Tue, Feb 3, 2009 at 6:03 PM, S D <sd.codewarr...@gmail.com> wrote: > Coincidentally I'm aware of the AWS::S3 package in Ruby but I'd prefer to > avoid that... > > On Tue, Feb 3, 2009 at 5:02 PM, S D <sd.codewarr...@gmail.com> wrote: > > > I'm at my wit's end. I want to do a simple test for the existence of a > file > > on Hadoop. Here is the Ruby code I'm trying: > > > > val = `hadoop dfs -test -e s3n://holeinthebucket/user/hadoop/file.txt` > > puts "Val: #{val}" > > if val == 1 > > // do one thing > > else > > // do another > > end > > > > I never get a return value for the -test command. Is there something I'm > > missing? How should the return value be retrieved? > > > > Thanks, > > SD > > >