[Bioc-devel] graph file

Kasper Daniel Hansen kasperdanielhansen at gmail.com
Mon Aug 27 17:40:06 CEST 2012


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.

>From ?gzfile
    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:
> confirmed at sessionInfo given below and on a similar mac devel build
>
> r-devel has some stuff on inherent bugginess of zlib, e.g,
>
> http://r.789695.n4.nabble.com/Issue-with-seek-on-gzipped-connections-in-R-devel-td3836934.html
>
> if this is a problem getting through check we could likely store the gxl
> stuff uncompressed
>
>
>
>> sessionInfo()
> R Under development (unstable) (2012-07-20 r59915)
> Platform: x86_64-unknown-linux-gnu (64-bit)
>
> locale:
>  [1] LC_CTYPE=en_US.ISO8859-1      LC_NUMERIC=C
>  [3] LC_TIME=en_US.ISO8859-1       LC_COLLATE=en_US.ISO8859-1
>  [5] LC_MONETARY=en_US.ISO8859-1   LC_MESSAGES=C
>  [7] LC_PAPER=C                    LC_NAME=C
>  [9] LC_ADDRESS=C                  LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.iso88591 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats     graphics  grDevices datasets  tools     utils     methods
> [8] base
>
> other attached packages:
> [1] graph_1.35.1         weaver_1.23.0        codetools_0.2-8
> [4] digest_0.5.2         BiocInstaller_1.5.12
>
> loaded via a namespace (and not attached):
> [1] BiocGenerics_0.3.0
>
>
> On Mon, Aug 27, 2012 at 10:16 AM, Kasper Daniel Hansen
> <kasperdanielhansen at gmail.com> wrote:
>>
>> (fixing some Rgraphviz stuff).
>>
>> If I do (in R)
>>
>> library(graph)
>> g1_gz <- gzfile(system.file("GXL/graphExample-01.gxl.gz",package="graph"),
>> open="rb")
>> readLines(g1_gz)
>>
>> I get
>>
>> Warning message:
>> In readLines(g1_gz) :
>>   seek on a gzfile connection returned an internal error
>>
>> but it seems to parse fine.  When I look at the file, say doing (in a
>> shell)
>>   gunzip -t graphExample_01.gxl.gz
>> it seems to be in good shape.
>>
>> Is there anyone who can hint at what is going on here?
>>
>> [ The warning is in
>>   src/main/connections.c
>> in the R sources ]
>>
>> Kasper
>>
>> _______________________________________________
>> Bioc-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>
>



More information about the Bioc-devel mailing list