joehl@web.de
2000-Dec-20 12:36 UTC
[Rd] unlink() is not synchronized with existing connections (PR#783)
> # creating a file > cat("sddfasdf", file="tempfile") > showConnections()class description mode text isopen can read can write> con <- file("tempfile", "r") > readLines(con)[1] "sddfasdf" Warning message: incomplete final line in: readLines(con, n, ok)> showConnections()class description mode text isopen can read can write 3 "tempfile" "file" "r" "text" "opened" "yes" "no"> unlink("tempfile") > showConnections()class description mode text isopen can read can write 3 "tempfile" "file" "r" "text" "opened" "yes" "no"> # now we have an opened (read) connection to a non-existing file leftBTW: this may be considered as a special case of a more general thing: undefined rights to modify/access connections owned by other parts of the software Regards Jens Oehlschlägel --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, Verschlüsselung, 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Prof Brian Ripley
2000-Dec-20 12:47 UTC
[Rd] unlink() is not synchronized with existing connections (PR#783)
On Wed, 20 Dec 2000 joehl@web.de wrote:> > # creating a file > > cat("sddfasdf", file="tempfile") > > showConnections() > class description mode text isopen can read can write > > con <- file("tempfile", "r") > > readLines(con) > [1] "sddfasdf" > Warning message: > incomplete final line in: readLines(con, n, ok) > > showConnections() > class description mode text isopen can read can write > 3 "tempfile" "file" "r" "text" "opened" "yes" "no" > > unlink("tempfile") > > showConnections() > class description mode text isopen can read can write > 3 "tempfile" "file" "r" "text" "opened" "yes" "no" > > # now we have an opened (read) connection to a non-existing file leftWhat's the problem? That's perfectly valid on OSes that support it (e.g. Unix and Windows NT). Unlinked files are *not* `non-existing'.> cat("sddfasdf", file="tempfile") > con <- file("tempfile", "r") > unlink("tempfile") > readLines(con)[1] "sddfasdf" Warning message: incomplete final line in: readLines(con, n, ok)> close(con)I am not sure what your point is here. Connections are experimental and we know it is possible to do silly things with them. But why would one? -- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Maybe Matching Threads
- unlink() is not synchronized with existing connections
- unlink() is not synchronized with existing connections (PR#785)
- showConnections() does not show closed (or non-opened) connections though help says so (PR#784)
- showConnections() does not show closed (or non-opened) connections though help says so
- file descriptor leak in getSrcLines in R 2.10.0 svn 48590