Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read from a file opened with open(:rw) in Rakudo #4241

Closed
p6rt opened this issue May 13, 2015 · 4 comments
Closed

Cannot read from a file opened with open(:rw) in Rakudo #4241

p6rt opened this issue May 13, 2015 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented May 13, 2015

Migrated from rt.perl.org#125170 (status was 'resolved')

Searchable as RT125170$

@p6rt
Copy link
Author

p6rt commented May 13, 2015

From @masak

<cygx> hm... if I read the code correctly, open(​:rw) doesn't actually
do what it promises - it gets adjusted to :w
<masak> cygx​: can you confirm that with a one-liner?
<cygx> I can confirm it with the source ;)
<cygx> https://github.com/rakudo/rakudo/blob/nom/src/core/IO/Handle.pm#L68
<cygx> masak​: my $f = open("test.txt", :rw); $f.write("hello".encode);
$f.seek(0, 0); say $f.read(5).decode
<cygx> => Reading from filehandle failed​: operation not permitted
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Oct 7, 2017

From @dogbert17

This was fixed ages ago which can be verified with

c​: releases my $f = open("/tmp/dasdasdasdastest.txt", :r, :w); $f.write("hello".encode); $f.seek(0); say $f.read(5).decode

also, tests are present in t/spec/S32-io/open.t. Setting to resolved.

@p6rt
Copy link
Author

p6rt commented Oct 7, 2017

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Oct 7, 2017

@dogbert17 - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Oct 7, 2017
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant