[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-devel
Subject:    Re: [Rd] isOpen() misbehaviour
From:       Karl Forner <karl.forner () gmail ! com>
Date:       2014-06-19 13:55:31
Message-ID: CAMd4_Af36cdVY45iOMJVneCXV_chgdM+RX5Q8dFN2YXuWuvHTA () mail ! gmail ! com
[Download RAW message or body]

Thanks Joris, it makes sense now, though the doc is a bit misleading.

On Thu, Jun 19, 2014 at 3:22 PM, Joris Meys <jorismeys@gmail.com> wrote:
> Hi Karl,
>
> that is expected. The moment you close a connection, it is destroyed as well
> (see ?close). A destroyed connection cannot be tested. In fact, I've used
> isOpen() only in combination with the argument rw.
>
>> con <- file("clipboard",open="r")
>> isOpen(con,"write")
> [1] FALSE
>
> cheers
>
>
> On Thu, Jun 19, 2014 at 3:10 PM, Karl Forner <karl.forner@gmail.com> wrote:
>>
>> Hello,
>>
>> >From the doc, it says:
>>  "isOpen returns a logical value, whether the connection is currently
>> open."
>>
>> But actually it seems to die on closed connections:
>> > con <- file()
>> > isOpen(con)
>> [1] TRUE
>> > close(con)
>> > isOpen(con)
>> Error in isOpen(con) : invalid connection
>>
>> Is it expected ?
>> Tested on R-3.0.2 and R version 3.1.0 Patched (2014-06-11 r65921) on
>> linux x86_64
>>
>> Karl
>>
>> ______________________________________________
>> R-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>
>
>
> --
> Joris Meys
> Statistical consultant
>
> Ghent University
> Faculty of Bioscience Engineering
> Department of Mathematical Modelling, Statistics and Bio-Informatics
>
> tel : +32 9 264 59 87
> Joris.Meys@Ugent.be
> -------------------------------
> Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic