Skip to content
Prev 3558 / 21312 Next

[Bioc-devel] graph file

Thanks both of you.

I thought it was crazy that I got a warning form using readLines on a
gzfile connection, so I did some testing.

If I open the connection with
  gzfile(FILE)
(default is open = ""), I do not get a warning

If I open it with
  gzfile(FILE, open = "rb")
I do get the warning.
The mode of a connection is determined when actually opened, which
     is deferred if ?open = ""? is given (the default for all but
     socket connections).  An explicit call to ?open? can specify the
     mode, but otherwise the mode will be ?"r"?.  (?gzfile?, ?bzfile?
     and ?xzfile? connections are exceptions, as the compressed file
     always has to be opened in binary mode and no conversion of
     line-endings is done even on Windows, so the default mode is
     interpreted as ?"rb"?.)  Most operations that need write access or
     text-only or binary-only mode will override the default mode of a
     non-yet-open connection.

This seems to indicate that open="" should do the same as open="rb",
but my testing seems to indicate that one gives the warning, the other
one doesn't.

Kasper

On Mon, Aug 27, 2012 at 10:34 AM, Vincent Carey
<stvjc at channing.harvard.edu> wrote: