any reason why this isn't a public function in FileUtils.js?  Seems handy to have for other modules/extensions to be able to use