Skip to content

Commit f658efe

Browse files
committed
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
1 parent bfc7bfd commit f658efe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/rex/ui/text/output/file.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ class Output::File < Rex::Ui::Text::Output
1414

1515
attr_accessor :fd
1616

17-
def initialize(path)
18-
self.fd = ::File.open(path, "wb")
17+
def initialize(path, mode='wb')
18+
self.fd = ::File.open(path, mode)
1919
end
2020

2121
def supports_color?

0 commit comments

Comments
 (0)