The Msf::Post::File mixin supports read_file() now to. You could use that instead.