[FixRM:#8126] -  Use functions from Msf::Post::File

Some functions already exist in Msf::Post::File, should use them.