Method: Bio::FlatFile::BufferedInputStream.open_file
- Defined in:
- lib/bio/io/flatfile/buffer.rb
.open_file(filename, *arg) ⇒ Object
Creates a new input stream wrapper to open file filename by using File.open. *arg is passed to File.open.
Like File.open, a block can be accepted.
Unlike File.open, the default is binary mode, unless text mode is explicity specified in mode.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/bio/io/flatfile/buffer.rb', line 49 def self.open_file(filename, *arg) params = _parse_file_open_arg(*arg) if params[:textmode] or /t/ =~ params[:fmode_string].to_s then textmode = true else textmode = false end if block_given? then File.open(filename, *arg) do |fobj| fobj.binmode unless textmode yield self.new(fobj, filename) end else fobj = File.open(filename, *arg) fobj.binmode unless textmode self.new(fobj, filename) end end |