From joehl@web.de  Wed Dec 20 12:42:43 2000
From: joehl@web.de (=?iso-8859-1?Q? Jens=20Oehlschl=E4gel ?=)
Date: Wed, 20 Dec 2000 13:42:43 +0100
Subject: [Rd] showConnections() does not show closed (or non-opened) connections though help says so
Message-ID: <200012201242.NAA18762@mailgate3.cinetic.de>

help on showConnections explains parameter
all logical: if true all connections, including closed ones and the standard ones are displayed. If false only open user-created connections are included. 

but

> # create a file 
> cat("TITLE extra line", "2 3 5 7", "", "11 13 17", file="ex.data",
+     sep="\n")
> showConnections(all=TRUE)
  class    description mode text   isopen   can read can write
0 "stdin"  "terminal"  "r"  "text" "opened" "yes"    "no"     
1 "stdout" "terminal"  "w"  "text" "opened" "no"     "yes"    
2 "stderr" "terminal"  "w"  "text" "opened" "no"     "yes"    
> 
> con <- file("ex.data")
> showConnections(all=TRUE)
  class    description mode text   isopen   can read can write
0 "stdin"  "terminal"  "r"  "text" "opened" "yes"    "no"     
1 "stdout" "terminal"  "w"  "text" "opened" "no"     "yes"    
2 "stderr" "terminal"  "w"  "text" "opened" "no"     "yes"    
> # here the connection (existing? but not-opened) is not listend 
> 
> open(con)
> showConnections(all=TRUE)
  class     description mode text   isopen   can read can write
0 "stdin"   "terminal"  "r"  "text" "opened" "yes"    "no"     
1 "stdout"  "terminal"  "w"  "text" "opened" "no"     "yes"    
2 "stderr"  "terminal"  "w"  "text" "opened" "no"     "yes"    
3 "ex.data" "file"      "r"  "text" "opened" "yes"    "no"     
> 
> close(con)
> showConnections(all=TRUE)
  class    description mode text   isopen   can read can write
0 "stdin"  "terminal"  "r"  "text" "opened" "yes"    "no"     
1 "stdout" "terminal"  "w"  "text" "opened" "no"     "yes"    
2 "stderr" "terminal"  "w"  "text" "opened" "no"     "yes"    
> 
> readLines("ex.data", n=-1)
[1] "TITLE extra line" "2 3 5 7"          ""                 "11 13 17"        
> showConnections(all=TRUE)
  class    description mode text   isopen   can read can write
0 "stdin"  "terminal"  "r"  "text" "opened" "yes"    "no"     
1 "stdout" "terminal"  "w"  "text" "opened" "no"     "yes"    
2 "stderr" "terminal"  "w"  "text" "opened" "no"     "yes"    
> # here we don't know whether showConnections() does not show a connection created and opened by readLine() 
> # or whether readLines() did also close the connection


Regards


Jens Oehlschlgel


--please do not edit the information below--

Version:
 platform = i386-pc-mingw32
 arch = x86
 os = Win32
 system = x86, Win32
 status = 
 major = 1
 minor = 2.0
 year = 2000
 month = 12
 day = 15
 language = R

Windows NT 4.0 (build 1381) Service Pack 6

Search Path:
 .GlobalEnv, package:ctest, Autoloads, package:base

______________________________________________________________________________
Die Fachpresse ist sich einig: WEB.DE 15mal Testsieger! Kostenlos E-Mail, 
Fax, SMS, Verschlsselung, POP3, WAP....testen Sie uns! http://freemail.web.de

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] showConnections() does not show closed (or non-opened) connections though help says so
=?iso-8859-1?Q? Jens=20Oehlschl=E4gel ?=