or

```Ruby

   data = ""
   File.open(datastore['LOCALFILE'], 'rb') {|f| data = f.read}

```

readability suffers a little, but the file handle is closed automatically
You probably also want some error handling and/or checking that the file is readable with File.readable? etc