Please use Msf::Post::File.expand_path, use of Post exploitation mixins are preferred because methods use to be multi platform and multi session.