Add the ability to specify mode in Rex output file

* Because sometimes you might want to append
* Preserves original hardcoded 'wb' as default
* http://pubs.opengroup.org/onlinepubs/009695399/functions/fopen.html
bug/bundler_fix
Trevor Rosen 2014-11-12 16:08:03 -06:00
parent bfc7bfdd9a
commit f658efe144
No known key found for this signature in database
GPG Key ID: 255ADB7A642D3928
1 changed files with 2 additions and 2 deletions

View File

@ -14,8 +14,8 @@ class Output::File < Rex::Ui::Text::Output
attr_accessor :fd
def initialize(path)
self.fd = ::File.open(path, "wb")
def initialize(path, mode='wb')
self.fd = ::File.open(path, mode)
end
def supports_color?