class File def File.my_open(*args) result = file = File.new(*args) if block_given? result = yield file file.close end return result end end