Subject: Re: [R] readLines() and unz() and non-empty final line
Hi again,
The unz connection is non-blocking by default. I checked do_unz which calls
R_newunz which calls init_con and the only place in any of those functions that
sets 'blocking' is init_con which sets it to FAL
half Of Kimmo Elo
Sent: Friday, 25 October 2024 15:21
To: r-help@r-project.org
Subject: Re: [R] readLines() and unz() and non-empty final line
[You don't often get email from kimmo@uef.fi. Learn why this is important
at https://aka.ms/LearnAboutSenderIdentification ]
Hi,
you could use
rom: Bert Gunter
Sent: Thursday, 24 October 2024 18:13
To: Iris Simmons
Cc: Marttila Mikko ; r-help@r-project.org
Subject: Re: [R] readLines() and unz() and non-empty final line
You don't often get email from
bgunter.4...@gmail.com<mailto:bgunter.4...@gmail.com>. Learn why this is
Hi,
you could use "scan" instead, it seems to work fine also when wrapped
around "unz".
Or, alternatively, you could use "unzip" instead of "unz". It works as
expected, i.e. reads the last incomplete line and throws a warning about
this.
So it seems to me that "unz" creates a non-blocking con
t; Calls: local ... eval.parent -> eval -> eval -> eval -> eval -> readLines
>
> Execution halted
>
> So, the behaviour of unz() seems to be different depending on whether it
> was explicitly opened before passed to readLines(). Should this be fixed or
> documented?
&
Dear list,
I'm seeing a strange interaction with readLines() and unz() when reading
a file without an empty final line. The final line gets dropped silently:
> cat("hello", file = "hello.txt")
> zip("hello.zip", "hello.txt")
adding: hello.txt (stored 0%)
> readLines(unz("hello.zip", "hello.txt"
-Original Message-
From: R-help On Behalf Of Marttila Mikko via
R-help
Sent: Thursday, October 24, 2024 8:00 AM
To: r-help@r-project.org
Subject: [R] readLines() and unz() and non-empty final line
[External Email]
Dear list,
I'm seeing a strange interaction with readLines() and unz()
But note:
> zip("hello.zip", "hello.txt")
updating: hello.txt (stored 0%)
> readChar(unz("hello.zip","hello.txt"),100)
[1] "hello"
I leave it to you and other wiser heads to figure out.
Cheers,
Bert
On Thu, Oct 24, 2024 at 8:57 AM Iris Simmons wrote:
> Hi Mikko,
>
>
> I tried running a few di
Hi Mikko,
I tried running a few different things, and it seems as though
explicitly using `open()` and opening a blocking connection works.
```R
cat("hello", file = "hello.txt")
zip("hello.zip", "hello.txt")
local({
conn <- unz("hello.zip", "hello.txt")
on.exit(close(conn))
## you ca
9 matches
Mail list logo